diff --git a/data/gresource.xml b/data/gresource.xml index 69e69cf5..7e848a6f 100644 --- a/data/gresource.xml +++ b/data/gresource.xml @@ -1,6 +1,9 @@ + icons/screencast.svg + icons/screencast.svg + icons/grab-area-symbolic.svg icons/grab-screen-symbolic.svg icons/grab-window-symbolic.svg diff --git a/data/icons/screencast.svg b/data/icons/screencast.svg new file mode 100644 index 00000000..690e16d8 --- /dev/null +++ b/data/icons/screencast.svg @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ScreenCast/Dialog.vala b/src/ScreenCast/Dialog.vala index 4bbe8fc8..072daeba 100644 --- a/src/ScreenCast/Dialog.vala +++ b/src/ScreenCast/Dialog.vala @@ -5,7 +5,7 @@ * Authored by: Leonhard Kargl */ -public class ScreenCast.Dialog : Granite.Dialog { +public class ScreenCast.Dialog : Granite.MessageDialog { public SourceType source_types { get; construct; } public bool allow_multiple { get; construct; } @@ -27,6 +27,7 @@ public class ScreenCast.Dialog : Granite.Dialog { monitor_rows = new List (); list_box = new Gtk.ListBox () { + hexpand = true, vexpand = true }; list_box.add_css_class (Granite.STYLE_CLASS_RICH_LIST); @@ -64,8 +65,9 @@ public class ScreenCast.Dialog : Granite.Dialog { child = scrolled_window }; - get_content_area ().append (frame); + custom_bin.append (frame); + resizable = true; default_height = 400; default_width = 300; diff --git a/src/ScreenCast/Portal.vala b/src/ScreenCast/Portal.vala index 2155ee91..38f7870c 100644 --- a/src/ScreenCast/Portal.vala +++ b/src/ScreenCast/Portal.vala @@ -115,7 +115,7 @@ public class ScreenCast.Portal : Object { start.callback (); }); - session.start (parent_window); + session.start (app_id, parent_window); yield; diff --git a/src/ScreenCast/Session.vala b/src/ScreenCast/Session.vala index 3f1324d1..fe5694b5 100644 --- a/src/ScreenCast/Session.vala +++ b/src/ScreenCast/Session.vala @@ -85,8 +85,19 @@ public class ScreenCast.Session : Object { this.cursor_mode = cursor_mode; } - internal void start (string parent_window) { - var dialog = new Dialog (source_types, allow_multiple); + internal void start (string app_id, string parent_window) { + var dialog = new Dialog (source_types, allow_multiple) { + image_icon = new ThemedIcon ("accessories-screencast-tool"), + primary_text = _("An application wants to access the screen"), + secondary_text = _("Select which parts of the screen to share:") + }; + + if (app_id != "") { + var app_info = new DesktopAppInfo (app_id + ".desktop"); + if (app_info != null) { + dialog.primary_text = _("ā€œ%sā€ wants to access the screen").printf (app_info.get_display_name ()); + } + } try { var parent = ExternalWindow.from_handle (parent_window);