diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-08-20 15:09:31 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-08-20 15:09:31 +0200 |
commit | 143bfc9f801c84428074312d661f8e08803df83b (patch) | |
tree | 59a8a447529bd9ce3807aa8bacef861dc5aafd70 /src/library/LibraryWindow.vala | |
parent | 29a7aef998e975b42401cfa96d1b750d91eadf06 (diff) |
Imported Upstream version 0.23.5upstream/0.23.5
Diffstat (limited to 'src/library/LibraryWindow.vala')
-rw-r--r-- | src/library/LibraryWindow.vala | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/library/LibraryWindow.vala b/src/library/LibraryWindow.vala index 21fc85e..19f819b 100644 --- a/src/library/LibraryWindow.vala +++ b/src/library/LibraryWindow.vala @@ -392,7 +392,13 @@ public class LibraryWindow : AppWindow { sidebar.label = _("S_idebar"); sidebar.tooltip = _("Display the sidebar"); actions += sidebar; - + + Gtk.ToggleActionEntry toolbar = { "CommonDisplayToolbar", null, TRANSLATABLE, + "<Ctrl>F9", TRANSLATABLE, on_display_toolbar, is_toolbar_visible() }; + toolbar.label = _("T_oolbar"); + toolbar.tooltip = _("Display the tool bar"); + actions += toolbar; + return actions; } @@ -837,7 +843,7 @@ public class LibraryWindow : AppWindow { set_sidebar_visible(((Gtk.ToggleAction) action).get_active()); } - + private void set_sidebar_visible(bool visible) { sidebar_paned.set_visible(visible); Config.Facade.get_instance().set_display_sidebar(visible); @@ -847,6 +853,22 @@ public class LibraryWindow : AppWindow { return Config.Facade.get_instance().get_display_sidebar(); } + private void on_display_toolbar (Gtk.Action action) { + set_toolbar_visible ((action as Gtk.ToggleAction).get_active ()); + } + + private void set_toolbar_visible (bool visible) { + var toolbar = get_current_page ().get_toolbar (); + if (toolbar != null) { + toolbar.set_visible (visible); + } + Config.Facade.get_instance().set_display_toolbar (visible); + } + + private bool is_toolbar_visible () { + return Config.Facade.get_instance ().get_display_toolbar (); + } + private void show_extended_properties() { sync_extended_properties(true); } @@ -1382,6 +1404,7 @@ public class LibraryWindow : AppWindow { if (toolbar != null) { right_vbox.add(toolbar); toolbar.show_all(); + toolbar.set_visible (this.is_toolbar_visible ()); } page.ready(); |