summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2021-12-23 17:04:24 +0000
committerAntónio Fernandes <antoniof@gnome.org>2022-01-02 12:48:43 +0000
commit72cc73da23d7777d408849d1706db6290ac03bad (patch)
treead6f862ad404e224a824f327c06c62b1d85b2963
parentc1fecf0ea9f8d88e30897ef41e0e11148dc69072 (diff)
downloadnautilus-72cc73da23d7777d408849d1706db6290ac03bad.tar.gz
Adw goodies
-rw-r--r--src/nautilus-toolbar.c10
-rw-r--r--src/resources/css/Adwaita.css5
-rw-r--r--src/resources/ui/nautilus-toolbar.ui105
3 files changed, 43 insertions, 77 deletions
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index 670508933..835d8add1 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -78,9 +78,8 @@ struct _NautilusToolbar
GtkWidget *operations_revealer;
GtkWidget *operations_icon;
- GtkWidget *view_toggle_button;
+ GtkWidget *view_split_button;
GtkWidget *view_toggle_icon;
- GtkWidget *view_button;
GMenuModel *view_menu;
GtkWidget *app_button;
@@ -1129,9 +1128,8 @@ nautilus_toolbar_class_init (NautilusToolbarClass *klass)
gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, operations_popover);
gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, operations_list);
gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, operations_revealer);
- gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, view_button);
gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, view_menu);
- gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, view_toggle_button);
+ gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, view_split_button);
gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, view_toggle_icon);
gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, app_button);
gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, undo_redo_section);
@@ -1226,7 +1224,7 @@ on_slot_toolbar_menu_sections_changed (NautilusToolbar *self,
new_sections = nautilus_window_slot_get_toolbar_menu_sections (slot);
- gtk_widget_set_sensitive (self->view_button, (new_sections != NULL));
+ gtk_widget_set_sensitive (self->view_split_button, (new_sections != NULL));
if (new_sections == NULL)
{
return;
@@ -1326,7 +1324,7 @@ nautilus_toolbar_set_window_slot_real (NautilusToolbar *self,
NULL);
self->tooltip_binding = g_object_bind_property_full (self->window_slot, "tooltip",
- self->view_toggle_button, "tooltip-text",
+ self->view_split_button, "tooltip-text",
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE,
(GBindingTransformFunc) nautilus_toolbar_view_toggle_tooltip_transform_to,
NULL,
diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css
index a05f44e27..4edefa206 100644
--- a/src/resources/css/Adwaita.css
+++ b/src/resources/css/Adwaita.css
@@ -29,11 +29,6 @@
background: none;
}
-.disclosure-button > * {
- padding-left: 4px;
- padding-right: 4px;
-}
-
/* Path bar */
.nautilus-path-bar > scrolledwindow {
diff --git a/src/resources/ui/nautilus-toolbar.ui b/src/resources/ui/nautilus-toolbar.ui
index 5c704e2c3..acdc2b98d 100644
--- a/src/resources/ui/nautilus-toolbar.ui
+++ b/src/resources/ui/nautilus-toolbar.ui
@@ -176,46 +176,45 @@
</object>
</child>
<child type="start">
- <object class="GtkBox" id="navigation_box">
+ <object class="GtkButton" id="back_button">
+ <property name="focusable">True</property>
+ <property name="tooltip_text" translatable="yes">Go back</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="action_name">win.back</property>
<child>
- <object class="GtkButton" id="back_button">
- <property name="focusable">True</property>
- <property name="tooltip_text" translatable="yes">Go back</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <property name="action_name">win.back</property>
- <child>
- <object class="GtkImage" id="back_icon">
- <property name="icon_name">go-previous-symbolic</property>
- <property name="icon_size">1</property>
- </object>
- </child>
- <style>
- <class name="image-button"/>
- </style>
+ <object class="GtkImage" id="back_icon">
+ <property name="icon_name">go-previous-symbolic</property>
+ <property name="icon_size">1</property>
</object>
</child>
+ <style>
+ <class name="image-button"/>
+ </style>
+ </object>
+ </child>
+ <child type="start">
+ <object class="GtkButton" id="forward_button">
+ <property name="focusable">True</property>
+ <property name="tooltip_text" translatable="yes">Go forward</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="action_name">win.forward</property>
<child>
- <object class="GtkButton" id="forward_button">
- <property name="focusable">True</property>
- <property name="tooltip_text" translatable="yes">Go forward</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <property name="action_name">win.forward</property>
- <child>
- <object class="GtkImage" id="forward_icon">
- <property name="icon_name">go-next-symbolic</property>
- <property name="icon_size">1</property>
- </object>
- </child>
- <style>
- <class name="image-button"/>
- </style>
+ <object class="GtkImage" id="forward_icon">
+ <property name="icon_name">go-next-symbolic</property>
+ <property name="icon_size">1</property>
</object>
</child>
<style>
- <class name="linked"/>
- <class name="raised"/>
+ <class name="image-button"/>
+ </style>
+ </object>
+ </child>
+ <child type="start">
+ <object class="GtkSeparator">
+ <style>
+ <class name="spacer"/>
</style>
</object>
</child>
@@ -249,45 +248,19 @@
</object>
</child>
<child>
- <object class="GtkBox">
+ <object class="AdwSplitButton" id="view_split_button">
<property name="halign">center</property>
<property name="valign">center</property>
<property name="margin_end">6</property>
+ <property name="focusable">True</property>
+ <property name="tooltip_text" translatable="yes">Toggle view</property>
+ <property name="action_name">slot.files-view-mode-toggle</property>
+ <property name="menu-model">view_menu</property>
<child>
- <object class="GtkButton" id="view_toggle_button">
- <property name="focusable">True</property>
- <property name="tooltip_text" translatable="yes">Toggle view</property>
- <property name="action_name">slot.files-view-mode-toggle</property>
- <child>
- <object class="GtkImage" id="view_toggle_icon">
- <property name="icon_size">1</property>
- </object>
- </child>
- <style>
- <class name="image-button"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkMenuButton" id="view_button">
- <property name="focusable">True</property>
- <property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes" comments="“View” is a noun">View options</property>
- <property name="halign">start</property>
- <property name="menu-model">view_menu</property>
- <child>
- <object class="GtkImage">
- <property name="icon_name">pan-down-symbolic</property>
- </object>
- </child>
- <style>
- <class name="disclosure-button"/>
- </style>
+ <object class="GtkImage" id="view_toggle_icon">
+ <property name="icon_size">1</property>
</object>
</child>
- <style>
- <class name="linked"/>
- </style>
</object>
</child>
<child>