diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2018-09-30 14:11:00 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2018-09-30 14:11:00 +0200 |
commit | 0ac947a9070322180e94d1b71e30836cce4d74bc (patch) | |
tree | 4a6f3923c250377536a5004ed203768111a1d27f /src/AppWindow.vala | |
parent | eca5837e235a356c8db9416bbbc13577db3e6f76 (diff) | |
parent | 01b2b5ec9177046f64c6d0a6e73a6ac8a42089a1 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/AppWindow.vala')
-rw-r--r-- | src/AppWindow.vala | 48 |
1 files changed, 15 insertions, 33 deletions
diff --git a/src/AppWindow.vala b/src/AppWindow.vala index aefe3c6..22b47c2 100644 --- a/src/AppWindow.vala +++ b/src/AppWindow.vala @@ -43,13 +43,13 @@ public class FullscreenWindow : PageWindow { // restore pin state is_toolbar_dismissal_enabled = Config.Facade.get_instance().get_pin_toolbar_state(); - pin_button.set_icon_name("pin-toolbar"); + pin_button.set_icon_name("view-pin-symbolic"); pin_button.set_label(_("Pin Toolbar")); pin_button.set_tooltip_text(_("Pin the toolbar open")); pin_button.set_active(!is_toolbar_dismissal_enabled); pin_button.clicked.connect(update_toolbar_dismissal); - close_button.set_icon_name("view-restore"); + close_button.set_icon_name("view-restore-symbolic"); close_button.set_tooltip_text(_("Leave fullscreen")); close_button.set_action_name ("win.LeaveFullscreen"); @@ -115,12 +115,8 @@ public class FullscreenWindow : PageWindow { } private Gdk.Rectangle get_monitor_geometry() { - Gdk.Rectangle monitor; - - get_screen().get_monitor_geometry( - get_screen().get_monitor_at_window(AppWindow.get_instance().get_window()), out monitor); - - return monitor; + var monitor = get_display().get_monitor_at_window(AppWindow.get_instance().get_window()); + return monitor.get_geometry(); } public override bool configure_event(Gdk.EventConfigure event) { @@ -195,15 +191,15 @@ public class FullscreenWindow : PageWindow { } private bool is_pointer_in_toolbar() { - Gdk.DeviceManager? devmgr = get_display().get_device_manager(); - if (devmgr == null) { - debug("No device manager for display"); + var seat = get_display().get_default_seat(); + if (seat == null) { + debug("No seat for display"); return false; } int py; - devmgr.get_client_pointer().get_position(null, null, out py); + seat.get_pointer().get_position(null, null, out py); int wy; toolbar.get_window().get_geometry(null, out wy, null, null); @@ -445,12 +441,8 @@ public abstract class AppWindow : PageWindow { add_actions (); Gtk.CssProvider provider = new Gtk.CssProvider(); - try { - provider.load_from_data(Resources.CUSTOM_CSS, -1); - Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); - } catch (Error err) { - debug("Unable to load custom CSS: %s", err.message); - } + provider.load_from_resource("/org/gnome/Shotwell/misc/org.gnome.Shotwell.css"); + Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); } private const GLib.ActionEntry[] common_actions = { @@ -597,9 +589,9 @@ public abstract class AppWindow : PageWindow { public abstract string get_app_role(); protected void on_about() { - const string[] artists = { "Braunschweiger Löwe created by Magnus Manske., CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=109735", null }; + const string[] artists = { "Celler Schloss created by Hajotthu, CC BY-SA 3.0, https://commons.wikimedia.org/wiki/File:Celler_Schloss_April_2010.jpg#file", null }; Gtk.show_about_dialog(this, - "version", Resources.APP_VERSION + " \u2013 \"Braunschweig\"", + "version", Resources.APP_VERSION + " \u2013 “Celle”", "comments", get_app_role(), "copyright", Resources.COPYRIGHT, "website", Resources.HOME_URL, @@ -615,7 +607,7 @@ public abstract class AppWindow : PageWindow { private void on_help_contents() { try { - Resources.launch_help(get_screen()); + Resources.launch_help(this); } catch (Error err) { error_message(_("Unable to display help: %s").printf(err.message)); } @@ -662,21 +654,11 @@ public abstract class AppWindow : PageWindow { } public void show_file_uri(File file) throws Error { - string tmp; - - // if file manager is nautilus then pass the full path to file; otherwise pass - // the enclosing directory - if(get_nautilus_install_location() != null) { - tmp = file.get_uri().replace("'","\\\'"); - show_file_in_nautilus(tmp); - } else { - tmp = file.get_parent().get_uri().replace("'","\\\'"); - show_uri(tmp); - } + show_file_in_filemanager.begin(file); } public void show_uri(string url) throws Error { - sys_show_uri(get_window().get_screen(), url); + Gtk.show_uri_on_window(this, url, Gdk.CURRENT_TIME); } protected virtual void add_actions () { |