diff options
author | António Fernandes <antoniof@gnome.org> | 2021-11-25 16:42:07 +0000 |
---|---|---|
committer | António Fernandes <antoniof@gnome.org> | 2021-12-06 00:24:52 +0000 |
commit | cfdee53695ab8c0a2ac222523f0759cea358e018 (patch) | |
tree | f9ad2119478507f2bb48d1db6f523cf82b1355c5 /src/resources/ui/nautilus-toolbar.ui | |
parent | 57e3910e5ec9142f8b90c6ac6c6294f75f299371 (diff) | |
download | nautilus-cfdee53695ab8c0a2ac222523f0759cea358e018.tar.gz |
toolbar: Use list box for operations list
Using a GtkBox to display a dynamic list requires us to manually add
and remove children, relying on the GtkContainer API, gone in GTK4.
Instead, we can use GtkListBox, which we can pass a model and let
it take care of creating and disposing of children for us.
After the GTK4 switch, we should probably replace it with GtkListView
to avoid the default behaviors of GtkListBox which we are adding
workarounds for.
Diffstat (limited to 'src/resources/ui/nautilus-toolbar.ui')
-rw-r--r-- | src/resources/ui/nautilus-toolbar.ui | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/resources/ui/nautilus-toolbar.ui b/src/resources/ui/nautilus-toolbar.ui index a1e6fccec..359f80aec 100644 --- a/src/resources/ui/nautilus-toolbar.ui +++ b/src/resources/ui/nautilus-toolbar.ui @@ -405,24 +405,18 @@ <property name="max_content_height">270</property> <property name="propagate_natural_height">True</property> <child> - <object class="GtkViewport"> + <object class="GtkListBox" id="operations_list"> <property name="visible">True</property> <property name="can_focus">False</property> - <child> - <object class="GtkBox" id="operations_container"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="margin_start">12</property> - <property name="margin_end">12</property> - <property name="margin_top">12</property> - <property name="margin_bottom">12</property> - <property name="orientation">vertical</property> - <property name="spacing">10</property> - <child> - <placeholder/> - </child> - </object> - </child> + <property name="margin_start">6</property> + <property name="margin_end">6</property> + <property name="margin_top">6</property> + <property name="margin_bottom">6</property> + <property name="selection-mode">none</property> + <property name="activate-on-single-click">False</property> + <style> + <class name="operations-list"/> + </style> </object> </child> </object> |