[dconf-editor] Improve Bookmarks on small screen.



commit 87514d78d9e25f58e6cac6ff876e11c8db33ce57
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Tue Oct 23 04:42:19 2018 +0200

    Improve Bookmarks on small screen.

 editor/browser-headerbar.ui   | 21 +++++++++++++++++++++
 editor/browser-headerbar.vala | 12 ++++++++++--
 2 files changed, 31 insertions(+), 2 deletions(-)
---
diff --git a/editor/browser-headerbar.ui b/editor/browser-headerbar.ui
index 2119f74..5f3d829 100644
--- a/editor/browser-headerbar.ui
+++ b/editor/browser-headerbar.ui
@@ -4,6 +4,27 @@
   <template class="BrowserHeaderBar" parent="GtkHeaderBar">
     <property name="show-close-button">True</property>
     <property name="has-subtitle">False</property>
+    <child>
+      <object class="GtkButton" id="hide_in_window_bookmarks_button">
+        <property name="visible">False</property>
+        <property name="action-name">ui.hide-in-window-bookmarks</property>
+        <style>
+          <class name="image-button"/>
+        </style>
+        <child>
+          <object class="GtkImage">
+            <property name="visible">True</property>
+            <property name="icon-name">go-previous-symbolic</property> <!-- TODO 3/3 
dialog-information-symbolic -->
+            <property name="icon-size">1</property>
+          </object>
+        </child>
+      </object>
+    </child>
+    <child>
+      <object class="GtkSeparator" id="bookmarks_actions_separator">
+        <property name="visible">False</property>
+      </object>
+    </child>
     <child type="title">
       <object class="GtkBox">
         <property name="visible">True</property>
diff --git a/editor/browser-headerbar.vala b/editor/browser-headerbar.vala
index 3ae9f5c..df99749 100644
--- a/editor/browser-headerbar.vala
+++ b/editor/browser-headerbar.vala
@@ -158,22 +158,29 @@ private class BrowserHeaderBar : HeaderBar, AdaptativeWidget
     [GtkChild] private Stack                bookmarks_stack;
     [GtkChild] private Label                bookmarks_label;
     [GtkChild] private BookmarksController  bookmarks_controller;
+    [GtkChild] private Button               hide_in_window_bookmarks_button;
+    [GtkChild] private Separator            bookmarks_actions_separator;
 
     bool in_window_bookmarks = false;
 
     internal void show_in_window_bookmarks ()
     {
         in_window_bookmarks = true;
+        info_button.hide ();
+        bookmarks_actions_separator.hide ();
         bookmarks_stack.hexpand = false;    // hack 1/3
         bookmarks_stack.set_visible_child (bookmarks_label);
-        update_hamburger_menu ();
+        hide_in_window_bookmarks_button.show ();
     }
 
     internal void hide_in_window_bookmarks ()
     {
+        hide_in_window_bookmarks_button.hide ();
+        bookmarks_actions_separator.hide ();
         in_window_bookmarks = false;
         bookmarks_stack.hexpand = false;    // hack 2/3
         bookmarks_stack.set_visible_child (path_widget);
+        info_button.show ();
         update_hamburger_menu ();
     }
 
@@ -181,6 +188,7 @@ private class BrowserHeaderBar : HeaderBar, AdaptativeWidget
         requires (in_window_bookmarks == true)
     {
         bookmarks_stack.hexpand = true;     // hack 3/3
+        bookmarks_actions_separator.show ();
         bookmarks_stack.set_visible_child (bookmarks_controller);
     }
 
@@ -262,7 +270,7 @@ private class BrowserHeaderBar : HeaderBar, AdaptativeWidget
         GLib.Menu section = new GLib.Menu ();
 
         if (in_window_bookmarks)
-            section.append (_("Hide bookmarks"), "ui.hide-in-window-bookmarks");
+            section.append (_("Hide bookmarks"), "ui.hide-in-window-bookmarks");    // button hidden in 
current design
         else
         {
             if (is_in_bookmarks)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]