[meld/pathlabel] Rework open/path label UI arrangement



commit b9efb67e1371a26137cac807eaedb5b4da0e8226
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Aug 22 10:39:54 2021 +1000

    Rework open/path label UI arrangement
    
    One of the weird things about the path label is that it means that the
    UI to open a new file is on the other side of the pane to the UI that
    shows you what file you're looking at. This is especially weird for
    version control view, since it has additional UI for selecting which
    version control system you're using.
    
    This commit switches these up to use a linked button UI for opening and
    labelling the files/folders being compared. This recovers a small amount
    of action bar space, but more importantly means that the file-y buttons
    are in the middle section, leaving the left section for any action-y
    buttons that we want. Also, it makes all of the file/folder/version
    control layouts consistent.

 meld/resources/ui/dirdiff.ui  | 114 ++++++++++++++++++++++-----------------
 meld/resources/ui/filediff.ui | 120 ++++++++++++++++++++++++------------------
 meld/resources/ui/vcview.ui   |  43 ++++++---------
 3 files changed, 152 insertions(+), 125 deletions(-)
---
diff --git a/meld/resources/ui/dirdiff.ui b/meld/resources/ui/dirdiff.ui
index fec969c8..33b0b7b5 100644
--- a/meld/resources/ui/dirdiff.ui
+++ b/meld/resources/ui/dirdiff.ui
@@ -17,26 +17,32 @@
           <object class="GtkActionBar" id="pane_actionbar0">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <child>
-              <object class="MeldFileButton" id="folder_open_button0">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="pane">0</property>
-                <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
-                <property name="dialog_label">Select Folder</property>
-                <property name="tooltip_text" translatable="yes">Select folder to open in this 
pane</property>
-                <signal name="file-selected" handler="on_file_selected" swapped="no"/>
-              </object>
-            </child>
             <child type="center">
-              <object class="PathLabel" id="folder_label0">
+              <object class="GtkBox">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Folder 1</property>
-                <property name="icon-name">folder-symbolic</property>
+                <property name="orientation">horizontal</property>
+                <property name="homogeneous">False</property>
                 <style>
-                  <class name="flat"/>
+                  <class name="linked"/>
                 </style>
+                <child>
+                  <object class="MeldFileButton" id="folder_open_button0">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="pane">0</property>
+                    <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
+                    <property name="dialog_label">Select Folder</property>
+                    <property name="tooltip_text" translatable="yes">Select folder to open in this 
pane</property>
+                    <signal name="file-selected" handler="on_file_selected" swapped="no"/>
+                  </object>
+                </child>
+                <child>
+                  <object class="PathLabel" id="folder_label0">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Folder 1</property>
+                  </object>
+                </child>
               </object>
             </child>
             <style>
@@ -52,26 +58,32 @@
           <object class="GtkActionBar" id="pane_actionbar1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <child>
-              <object class="MeldFileButton" id="folder_open_button1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="pane">1</property>
-                <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
-                <property name="dialog_label">Select Folder</property>
-                <property name="tooltip_text" translatable="yes">Select folder to open in this 
pane</property>
-                <signal name="file-selected" handler="on_file_selected" swapped="no"/>
-              </object>
-            </child>
             <child type="center">
-              <object class="PathLabel" id="folder_label1">
+              <object class="GtkBox">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Folder 2</property>
-                <property name="icon-name">folder-symbolic</property>
+                <property name="orientation">horizontal</property>
+                <property name="homogeneous">False</property>
                 <style>
-                  <class name="flat"/>
+                  <class name="linked"/>
                 </style>
+                <child>
+                  <object class="MeldFileButton" id="folder_open_button1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="pane">1</property>
+                    <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
+                    <property name="dialog_label">Select Folder</property>
+                    <property name="tooltip_text" translatable="yes">Select folder to open in this 
pane</property>
+                    <signal name="file-selected" handler="on_file_selected" swapped="no"/>
+                  </object>
+                </child>
+                <child>
+                  <object class="PathLabel" id="folder_label1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Folder 2</property>
+                  </object>
+                </child>
               </object>
             </child>
             <style>
@@ -87,26 +99,32 @@
           <object class="GtkActionBar" id="pane_actionbar2">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <child>
-              <object class="MeldFileButton" id="folder_open_button2">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="pane">2</property>
-                <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
-                <property name="dialog_label">Select Folder</property>
-                <property name="tooltip_text" translatable="yes">Select folder to open in this 
pane</property>
-                <signal name="file-selected" handler="on_file_selected" swapped="no"/>
-              </object>
-            </child>
             <child type="center">
-              <object class="PathLabel" id="folder_label2">
+              <object class="GtkBox">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Folder 3</property>
-                <property name="icon-name">folder-symbolic</property>
+                <property name="orientation">horizontal</property>
+                <property name="homogeneous">False</property>
                 <style>
-                  <class name="flat"/>
+                  <class name="linked"/>
                 </style>
+                <child>
+                  <object class="MeldFileButton" id="folder_open_button2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="pane">2</property>
+                    <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
+                    <property name="dialog_label">Select Folder</property>
+                    <property name="tooltip_text" translatable="yes">Select folder to open in this 
pane</property>
+                    <signal name="file-selected" handler="on_file_selected" swapped="no"/>
+                  </object>
+                </child>
+                <child>
+                  <object class="PathLabel" id="folder_label2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Folder 3</property>
+                  </object>
+                </child>
               </object>
             </child>
             <style>
diff --git a/meld/resources/ui/filediff.ui b/meld/resources/ui/filediff.ui
index 521b5ad1..2ea45021 100644
--- a/meld/resources/ui/filediff.ui
+++ b/meld/resources/ui/filediff.ui
@@ -38,18 +38,6 @@
                 </child>
               </object>
             </child>
-            <child>
-              <object class="MeldFileButton" id="file_open_button2">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="pane">2</property>
-                <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
-                <property name="local-only">False</property>
-                <property name="dialog_label">Select File</property>
-                <property name="tooltip_text" translatable="yes">Open file in this pane</property>
-                <signal name="file-selected" handler="on_file_selected" swapped="no"/>
-              </object>
-            </child>
             <child>
               <object class="GtkButton" id="file_save_button2">
                 <property name="visible">True</property>
@@ -65,14 +53,32 @@
               </object>
             </child>
             <child type="center">
-              <object class="PathLabel" id="filelabel2">
+              <object class="GtkBox">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">File 3</property>
-                <property name="icon-name">text-x-generic-symbolic</property>
+                <property name="orientation">horizontal</property>
+                <property name="homogeneous">False</property>
                 <style>
-                  <class name="flat"/>
+                  <class name="linked"/>
                 </style>
+                <child>
+                  <object class="MeldFileButton" id="file_open_button2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="pane">2</property>
+                    <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
+                    <property name="local-only">False</property>
+                    <property name="dialog_label">Select File</property>
+                    <property name="tooltip_text" translatable="yes">Open file in this pane</property>
+                    <signal name="file-selected" handler="on_file_selected" swapped="no"/>
+                  </object>
+                </child>
+                <child>
+                  <object class="PathLabel" id="filelabel2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">File 3</property>
+                  </object>
+                </child>
               </object>
             </child>
             <style>
@@ -101,18 +107,6 @@
                 </child>
               </object>
             </child>
-            <child>
-              <object class="MeldFileButton" id="file_open_button1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="pane">1</property>
-                <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
-                <property name="local-only">False</property>
-                <property name="dialog_label">Select File</property>
-                <property name="tooltip_text" translatable="yes">Open file in this pane</property>
-                <signal name="file-selected" handler="on_file_selected" swapped="no"/>
-              </object>
-            </child>
             <child>
               <object class="GtkButton" id="file_save_button1">
                 <property name="visible">True</property>
@@ -128,14 +122,32 @@
               </object>
             </child>
             <child type="center">
-              <object class="PathLabel" id="filelabel1">
+              <object class="GtkBox">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">File 2</property>
-                <property name="icon-name">text-x-generic-symbolic</property>
+                <property name="orientation">horizontal</property>
+                <property name="homogeneous">False</property>
                 <style>
-                  <class name="flat"/>
+                  <class name="linked"/>
                 </style>
+                <child>
+                  <object class="MeldFileButton" id="file_open_button1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="pane">1</property>
+                    <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
+                    <property name="local-only">False</property>
+                    <property name="dialog_label">Select File</property>
+                    <property name="tooltip_text" translatable="yes">Open file in this pane</property>
+                    <signal name="file-selected" handler="on_file_selected" swapped="no"/>
+                  </object>
+                </child>
+                <child>
+                  <object class="PathLabel" id="filelabel1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">File 2</property>
+                  </object>
+                </child>
               </object>
             </child>
             <style>
@@ -164,18 +176,6 @@
                 </child>
               </object>
             </child>
-            <child>
-              <object class="MeldFileButton" id="file_open_button0">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="pane">0</property>
-                <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
-                <property name="local-only">False</property>
-                <property name="dialog_label">Select File</property>
-                <property name="tooltip_text" translatable="yes">Open file in this pane</property>
-                <signal name="file-selected" handler="on_file_selected" swapped="no"/>
-              </object>
-            </child>
             <child>
               <object class="GtkButton" id="file_save_button0">
                 <property name="visible">True</property>
@@ -191,14 +191,32 @@
               </object>
             </child>
             <child type="center">
-              <object class="PathLabel" id="filelabel0">
+              <object class="GtkBox">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">File 1</property>
-                <property name="icon-name">text-x-generic-symbolic</property>
+                <property name="orientation">horizontal</property>
+                <property name="homogeneous">False</property>
                 <style>
-                  <class name="flat"/>
+                  <class name="linked"/>
                 </style>
+                <child>
+                  <object class="MeldFileButton" id="file_open_button0">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="pane">0</property>
+                    <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
+                    <property name="local-only">False</property>
+                    <property name="dialog_label">Select File</property>
+                    <property name="tooltip_text" translatable="yes">Open file in this pane</property>
+                    <signal name="file-selected" handler="on_file_selected" swapped="no"/>
+                  </object>
+                </child>
+                <child>
+                  <object class="PathLabel" id="filelabel0">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">File 1</property>
+                  </object>
+                </child>
               </object>
             </child>
             <style>
diff --git a/meld/resources/ui/vcview.ui b/meld/resources/ui/vcview.ui
index 96ceff49..552f6924 100644
--- a/meld/resources/ui/vcview.ui
+++ b/meld/resources/ui/vcview.ui
@@ -9,18 +9,6 @@
       <object class="GtkActionBar" id="file_toolbar">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <child>
-          <object class="MeldFileButton" id="file_open_button0">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="pane">0</property>
-            <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
-            <property name="local-only">True</property>
-            <property name="dialog_label">Select Folder</property>
-            <property name="tooltip_text" translatable="yes">Open version controlled folder in this 
pane</property>
-            <signal name="file-selected" handler="on_file_selected" swapped="no"/>
-          </object>
-        </child>
         <child>
           <object class="GtkButton">
             <property name="visible">True</property>
@@ -150,25 +138,29 @@
         <child type="center">
           <object class="GtkBox">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="margin-start">6</property>
-            <property name="margin-end">6</property>
             <property name="orientation">horizontal</property>
+            <property name="homogeneous">False</property>
+            <style>
+              <class name="linked"/>
+            </style>
+            <child>
+              <object class="MeldFileButton" id="file_open_button0">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="pane">0</property>
+                <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
+                <property name="local-only">True</property>
+                <property name="dialog_label">Select Folder</property>
+                <property name="tooltip_text" translatable="yes">Open version controlled folder in this 
pane</property>
+                <signal name="file-selected" handler="on_file_selected" swapped="no"/>
+              </object>
+            </child>
             <child>
               <object class="PathLabel" id="filelabel">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">File 1</property>
-                <property name="icon-name">text-x-generic-symbolic</property>
-                <style>
-                  <class name="flat"/>
-                </style>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
             </child>
             <child>
               <object class="GtkComboBox" id="combobox_vcs">
@@ -191,8 +183,7 @@
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
+                <property name="fill">False</property>
               </packing>
             </child>
           </object>


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