[devhelp] Window: move New Tab button on the right side of the headerbar



commit 917717831dd4ac5a4276d0f725f71c9ca564d264
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Dec 6 14:55:33 2017 +0100

    Window: move New Tab button on the right side of the headerbar
    
    Remember, commit f07f4bada6d0a68b2f2828e1f1b5a47518a7078b moved the New
    Tab action from the hamburger menu to the headerbar. In the headerbar,
    it was placed on the left side, after the back/forward buttons.
    
    It's me who did this change, but most of the time I still try to go to
    the hamburger menu to open a new tab… Maybe it's because it's difficult
    to change my habits. But I think it's not only that: when opening a new
    tab, the new tab appears on the right side of the window. The New Tab
    button was placed on the opposite side, and to make things worse it was
    above the side panel (if visible), not above the html pages.
    
    So by placing the New Tab button on the right side of the headerbar (on
    the left of the hamburger menu), the button is closer to what the action
    does. It's more logical.
    
    Ideally GtkNotebook (or in the future a GtkStackSwitcher) should have a
    [+] button to open a new tab, like in Firefox currently, but I don't
    think it's easily achievable with GtkNotebook right now.

 src/dh-window.ui |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/src/dh-window.ui b/src/dh-window.ui
index 6e6a29c..2846a01 100644
--- a/src/dh-window.ui
+++ b/src/dh-window.ui
@@ -169,43 +169,43 @@
           </packing>
         </child>
         <child>
-          <object class="GtkButton" id="new_tab_button">
+          <object class="GtkMenuButton" id="gear_menu_button">
             <property name="visible">True</property>
             <property name="valign">center</property>
             <property name="can_focus">False</property>
-            <property name="tooltip_text" translatable="yes">New Tab</property>
-            <property name="action_name">win.new-tab</property>
+            <property name="action_name">win.gear-menu</property>
+            <property name="menu_model">gear_menu</property>
+            <property name="use_popover">True</property>
             <style>
               <class name="image-button"/>
             </style>
             <child>
-              <object class="GtkImage" id="new_tab_button_image">
+              <object class="GtkImage" id="gear_image">
                 <property name="visible">True</property>
                 <property name="icon_size">1</property>
-                <property name="icon_name">tab-new-symbolic</property>
+                <property name="icon_name">open-menu-symbolic</property>
               </object>
             </child>
           </object>
           <packing>
-            <property name="pack_type">start</property>
+            <property name="pack_type">end</property>
           </packing>
         </child>
         <child>
-          <object class="GtkMenuButton" id="gear_menu_button">
+          <object class="GtkButton" id="new_tab_button">
             <property name="visible">True</property>
             <property name="valign">center</property>
             <property name="can_focus">False</property>
-            <property name="action_name">win.gear-menu</property>
-            <property name="menu_model">gear_menu</property>
-            <property name="use_popover">True</property>
+            <property name="tooltip_text" translatable="yes">New Tab</property>
+            <property name="action_name">win.new-tab</property>
             <style>
               <class name="image-button"/>
             </style>
             <child>
-              <object class="GtkImage" id="gear_image">
+              <object class="GtkImage" id="new_tab_button_image">
                 <property name="visible">True</property>
                 <property name="icon_size">1</property>
-                <property name="icon_name">open-menu-symbolic</property>
+                <property name="icon_name">tab-new-symbolic</property>
               </object>
             </child>
           </object>


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