filechooserwidget: Add toggle view button clone in search
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 26 Oct 2022 18:01:20 +0000 (15:01 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 13 Dec 2022 17:45:15 +0000 (14:45 -0300)
It's positioned and looks exactly like the browse_toggle_view_button,
but due to the way things are organized, we cannot simply reuse that
button.

Add a clone of browse_toggle_view_button in the search entry page of
the toolbar stack. Make it toggle the same action as of the original
button, and bind the icon name and tooltip texts to it too.

gtk/ui/gtkfilechooserwidget.ui

index 2dfaebb4740ec63e10a37556d27bba76be63de8f..6df28903a54898b1825ce8db7e90b39573194a5a 100644 (file)
                                           </object>
                                         </child>
                                         <child type="end">
-                                          <object class="GtkSpinner" id="search_spinner">
-                                            <property name="visible">0</property>
+                                          <object class="GtkBox">
+                                            <property name="spacing">6</property>
+
+                                            <child>
+                                              <object class="GtkSpinner" id="search_spinner">
+                                                <property name="visible">0</property>
+                                              </object>
+                                            </child>
+
+                                            <child>
+                                              <object class="GtkButton">
+                                                <property name="action-name">item.toggle-view</property>
+                                                <binding name="icon-name">
+                                                  <lookup name="icon-name">browse_toggle_view_button</lookup>
+                                                </binding>
+                                                <binding name="tooltip-text">
+                                                  <lookup name="tooltip-text">browse_toggle_view_button</lookup>
+                                                </binding>
+                                              </object>
+                                            </child>
                                           </object>
                                         </child>
                                       </object>