From bb31794019091ff59438b8fa10440e9230614c7a Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Fri, 7 Jan 2022 08:40:54 +0100 Subject: [PATCH 01/13] window: Drop size-allocate usage The `size-allocate` signal is used to determine width of the sidebar, but it is no more availabe in GTK 4. Let's use `notifiy::position` on `GtkPaned` instead to get rid of the runtime warnings. --- src/nautilus-window.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/nautilus-window.c b/src/nautilus-window.c index 244adbf2a3..93d3b56ff9 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -829,12 +829,12 @@ save_sidebar_width_cb (gpointer user_data) /* side pane helpers */ static void -side_pane_size_allocate_callback (GtkWidget *widget, - GtkAllocation *allocation, - gpointer user_data) +side_pane_notify_position_callback (GObject *object, + GParamSpec *pspec, + gpointer user_data) { NautilusWindow *window = user_data; - + gint position; if (window->sidebar_width_handler_id != 0) { @@ -842,10 +842,11 @@ side_pane_size_allocate_callback (GtkWidget *widget, window->sidebar_width_handler_id = 0; } - if (allocation->width != window->side_pane_width && - allocation->width > 1) + position = gtk_paned_get_position (GTK_PANED (window->content_paned)); + if (position != window->side_pane_width && + position > 1) { - window->side_pane_width = allocation->width; + window->side_pane_width = position; window->sidebar_width_handler_id = g_idle_add (save_sidebar_width_cb, window); @@ -1312,9 +1313,9 @@ static void nautilus_window_set_up_sidebar (NautilusWindow *window) { setup_side_pane_width (window); - g_signal_connect (window->sidebar, - "size-allocate", - G_CALLBACK (side_pane_size_allocate_callback), + g_signal_connect (window->content_paned, + "notify::position", + G_CALLBACK (side_pane_notify_position_callback), window); nautilus_gtk_places_sidebar_set_open_flags (NAUTILUS_GTK_PLACES_SIDEBAR (window->places_sidebar), -- GitLab From c8fa38f67d646c10ec7068fe6ffd6755f5352709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Fri, 31 Dec 2021 18:15:30 +0000 Subject: [PATCH 02/13] general: Drop parameter from GtkEntry::icon-* signals The signal signature changed and doesn't include a GdkEvent anymore. --- src/nautilus-compress-dialog-controller.c | 1 - src/nautilus-location-entry.c | 1 - src/nautilus-search-popover.c | 1 - 3 files changed, 3 deletions(-) diff --git a/src/nautilus-compress-dialog-controller.c b/src/nautilus-compress-dialog-controller.c index 17a5be4b7d..13ac2548b0 100644 --- a/src/nautilus-compress-dialog-controller.c +++ b/src/nautilus-compress-dialog-controller.c @@ -308,7 +308,6 @@ passphrase_entry_on_changed (GtkEditable *editable, static void passphrase_entry_on_icon_press (GtkEntry *entry, GtkEntryIconPosition icon_pos, - GdkEvent *event, gpointer user_data) { NautilusCompressDialogController *self; diff --git a/src/nautilus-location-entry.c b/src/nautilus-location-entry.c index 73fda840f5..bc37cc201b 100644 --- a/src/nautilus-location-entry.c +++ b/src/nautilus-location-entry.c @@ -644,7 +644,6 @@ nautilus_location_entry_text_changed (NautilusLocationEntry *entry, static void nautilus_location_entry_icon_release (GtkEntry *gentry, GtkEntryIconPosition position, - GdkEvent *event, gpointer unused) { NautilusLocationEntry *entry; diff --git a/src/nautilus-search-popover.c b/src/nautilus-search-popover.c index 20559fa9eb..be30c7fe0a 100644 --- a/src/nautilus-search-popover.c +++ b/src/nautilus-search-popover.c @@ -278,7 +278,6 @@ select_type_button_clicked (GtkButton *button, static void toggle_calendar_icon_clicked (GtkEntry *entry, GtkEntryIconPosition position, - GdkEvent *event, NautilusSearchPopover *popover) { const gchar *current_visible_child; -- GitLab From 422b772cc18e19febce439f2edaa2e2aa53e53a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Sat, 1 Jan 2022 18:28:15 +0000 Subject: [PATCH 03/13] application: Unconditionally add custom styles With libadwaita, the existing code wasn't loading the custom themes as it should. But thanks to libadwaita, we can make assumptions on the existing stylesheet. In the future we may want to unify our 2 css files and maybe adopt AdwApplication to have it load the custom styles automatically. --- src/nautilus-application.c | 43 +++++--------------------------------- 1 file changed, 5 insertions(+), 38 deletions(-) diff --git a/src/nautilus-application.c b/src/nautilus-application.c index 505001f1a0..d7854dcecd 100644 --- a/src/nautilus-application.c +++ b/src/nautilus-application.c @@ -1113,45 +1113,29 @@ nautilus_application_init (NautilusApplication *self) } static void -theme_changed (GtkSettings *settings) +setup_theme_extensions (void) { static GtkCssProvider *provider = NULL; static GtkCssProvider *permanent_provider = NULL; - gchar *theme; GdkDisplay *display; - GFile *file; - g_object_get (settings, "gtk-theme-name", &theme, NULL); display = gdk_display_get_default (); /* CSS that themes can override */ - if (g_str_equal (theme, "Adwaita") || g_str_equal (theme, "Adwaita-dark")) + if (provider == NULL) { - if (provider == NULL) - { - provider = gtk_css_provider_new (); - file = g_file_new_for_uri ("resource:///org/gnome/nautilus/css/Adwaita.css"); - gtk_css_provider_load_from_file (provider, file); - g_object_unref (file); - } - + provider = gtk_css_provider_new (); + gtk_css_provider_load_from_resource (provider, "/org/gnome/nautilus/css/Adwaita.css"); gtk_style_context_add_provider_for_display (display, GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); } - else if (provider != NULL) - { - gtk_style_context_remove_provider_for_display (display, - GTK_STYLE_PROVIDER (provider)); - g_clear_object (&provider); - } /* CSS we want to always load for any theme */ if (permanent_provider == NULL) { permanent_provider = gtk_css_provider_new (); - file = g_file_new_for_uri ("resource:///org/gnome/nautilus/css/nautilus.css"); - gtk_css_provider_load_from_file (permanent_provider, file); + gtk_css_provider_load_from_resource (permanent_provider, "/org/gnome/nautilus/css/nautilus.css"); /* The behavior of two style providers with the same priority is * undefined and gtk happens to prefer the provider that got added last. * Use a higher priority here to avoid this problem. @@ -1159,24 +1143,7 @@ theme_changed (GtkSettings *settings) gtk_style_context_add_provider_for_display (display, GTK_STYLE_PROVIDER (permanent_provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1); - g_object_unref (file); } - - g_free (theme); -} - -static void -setup_theme_extensions (void) -{ - GtkSettings *settings; - - /* Set up a handler to load our custom css for Adwaita. - * See https://bugzilla.gnome.org/show_bug.cgi?id=732959 - * for a more automatic solution that is still under discussion. - */ - settings = gtk_settings_get_default (); - g_signal_connect (settings, "notify::gtk-theme-name", G_CALLBACK (theme_changed), NULL); - theme_changed (settings); } NautilusApplication * -- GitLab From 856c3a09b939ff5342203024a30e16490afae2da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Sat, 1 Jan 2022 18:48:39 +0000 Subject: [PATCH 04/13] css: Drop unused, redundant or obsolete styles --- src/resources/css/Adwaita.css | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css index 8a0bb9c012..92d1870ec1 100644 --- a/src/resources/css/Adwaita.css +++ b/src/resources/css/Adwaita.css @@ -1,9 +1,3 @@ -.nautilus-window, -.nautilus-window notebook, -.nautilus-window notebook > stack { - background: @theme_base_color; -} - .nautilus-empty-state-icon { opacity: 0.50; } @@ -78,32 +72,6 @@ opacity: 1; } -/* Make the tags fit into the box */ -entry.search > * { - margin: 5px; -} - -/* Sidebar */ - -.nautilus-window .sidebar-row:selected { - background: mix(@theme_bg_color, @theme_fg_color, 0.07); -} - -.nautilus-window .sidebar-row:selected, -.nautilus-window .sidebar-row:selected image, -.nautilus-window .sidebar-row:selected label { - color: mix(@theme_fg_color, @theme_text_color, 0.5); -} - -.nautilus-window .sidebar-row:selected:backdrop { - background: mix(@theme_unfocused_bg_color, @theme_unfocused_fg_color, 0.07); -} - -.nautilus-window .sidebar-row:selected:backdrop, -.nautilus-window .sidebar-row:selected:backdrop label { - color: mix(@theme_unfocused_fg_color, @theme_unfocused_text_color, 0.15); -} - /* Floating status bar */ .floating-bar { padding: 3px; @@ -230,9 +198,6 @@ flowboxchild:selected .icon-ui-labels-box { } flowboxchild:selected image { - -gtk-icon-effect: dim; /* GTK 3 only */ - /* GTK 4 TODO: Replace previous line with the following one: -gtk-icon-filter: opacity(0.5); - */ -gtk-icon-shadow: 0px 0px @theme_selected_bg_color; } -- GitLab From 69077a04ae2836ddf2658af07a6d7095c00571a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Sat, 1 Jan 2022 20:03:25 +0000 Subject: [PATCH 05/13] view-icon-controller: Set .view style class Removing redundant custom styles revealed we weren't adding this the class to this view, as we should. --- src/nautilus-view-icon-controller.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nautilus-view-icon-controller.c b/src/nautilus-view-icon-controller.c index ffd12e4328..f460440345 100644 --- a/src/nautilus-view-icon-controller.c +++ b/src/nautilus-view-icon-controller.c @@ -1478,6 +1478,7 @@ nautilus_view_icon_controller_class_init (NautilusViewIconControllerClass *klass static void nautilus_view_icon_controller_init (NautilusViewIconController *self) { + gtk_widget_add_css_class (GTK_WIDGET (self), "view"); set_click_mode_from_settings (self); g_signal_connect_swapped (nautilus_preferences, -- GitLab From 8e1416a652e5de569f3aeafe7158bae9c198084f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Sat, 1 Jan 2022 18:56:34 +0000 Subject: [PATCH 06/13] css: Update custom styles for current stylesheet --- src/resources/css/Adwaita.css | 38 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css index 92d1870ec1..218a0ede8c 100644 --- a/src/resources/css/Adwaita.css +++ b/src/resources/css/Adwaita.css @@ -29,25 +29,25 @@ background: none; } -.disclosure-button { +.disclosure-button > * { padding-left: 4px; padding-right: 4px; } /* Path bar */ -.nautilus-path-bar scrolledwindow { - border-radius: 5px 0px 0px 5px; - border: 1px @borders solid; +.nautilus-path-bar > scrolledwindow { + margin: 6px 0px 6px 0px; + border-radius: 6px 0px 0px 6px; border-right-width: 0px; - background-color: @theme_bg_color; + background-color: alpha(currentColor, 0.1); } -.path-bar-box scrolledwindow undershoot.left { - border-radius: 5px 0px 0px 5px; - background: linear-gradient(to right, @theme_bg_color 6px, alpha(@theme_bg_color, 0) 24px); +.nautilus-path-bar > scrolledwindow undershoot.left { + border-radius: 6px 0px 0px 6px; + background: linear-gradient(to right, @headerbar_shade_color 6px, alpha(@headerbar_shade_color, 0) 24px); } -.path-bar-box scrolledwindow undershoot.right { - background: linear-gradient(to left, @theme_bg_color 6px, alpha(@theme_bg_color, 0) 24px); +.nautilus-path-bar > scrolledwindow undershoot.right { + background: linear-gradient(to left, @headerbar_shade_color 6px, alpha(@headerbar_shade_color, 0) 24px); } .nautilus-path-bar > button, @@ -56,19 +56,20 @@ } .path-buttons-box button { - background-image: none; + margin: 0px; box-shadow: none; border-radius: 7px; border-width: 0px; -gtk-icon-shadow: none; } -.path-buttons-box button:not(.current-dir):not(:backdrop):hover { - background: alpha(@theme_fg_color, 0.15); - box-shadow: inset 0 0 0 2px @theme_bg_color; +.path-buttons-box button:not(:hover), +.path-buttons-box button.current-dir +{ + background: none; } -.path-buttons-box button:not(.current-dir):not(:backdrop):hover * { +.path-buttons-box button:not(.current-dir):not(:backdrop):hover label { opacity: 1; } @@ -79,7 +80,7 @@ border-width: 1px; border-style: solid solid none; border-color: @borders; - border-radius: 8px 8px 0 0; + border-radius: 8px 0 0 0; } .floating-bar.bottom.left { /* axes left border and border radius */ @@ -167,7 +168,7 @@ /* Icon view */ flowbox { - padding: 18px + padding: 18px; } flowboxchild { @@ -176,7 +177,6 @@ flowboxchild { flowboxchild:selected { background-color:transparent; - outline-color: transparent; } flowboxchild .thumbnail { @@ -189,7 +189,7 @@ flowboxchild .thumbnail { .icon-ui-labels-box { padding: 2px 4px; - border-radius: 4px; + border-radius: 5px; } flowboxchild:selected .icon-ui-labels-box { -- GitLab From 76413b8b9c31ddead94d8d8df7a82ebac0ad0147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Sat, 1 Jan 2022 18:58:59 +0000 Subject: [PATCH 07/13] css: Replace legacy color names With the actual colors they are now alias for. --- src/resources/css/Adwaita.css | 39 +++++++++++++---------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css index 218a0ede8c..7c4d687e4c 100644 --- a/src/resources/css/Adwaita.css +++ b/src/resources/css/Adwaita.css @@ -9,8 +9,8 @@ @keyframes needs_attention_keyframes { 0% {background-image: linear-gradient(to bottom, #fafafa, #ededed 40%, #e0e0e0); border-color: @borders; } /* can't do animation-direction, so holding the color on two keyframes */ - 30% {background-image: linear-gradient(to bottom, @theme_base_color, @theme_base_color, @theme_base_color); border-color: @theme_fg_color; } - 90% {background-image: linear-gradient(to bottom, @theme_base_color, @theme_base_color, @theme_base_color); border-color: @theme_fg_color; } + 30% {background-image: linear-gradient(to bottom, @view_bg_color, @view_bg_color, @view_bg_color); border-color: @window_fg_color; } + 90% {background-image: linear-gradient(to bottom, @view_bg_color, @view_bg_color, @view_bg_color); border-color: @window_fg_color; } 100% {background-image: linear-gradient(to bottom, #fafafa, #ededed 40%, #e0e0e0); border-color: @borders; } } @@ -76,7 +76,7 @@ /* Floating status bar */ .floating-bar { padding: 3px; - background-color: @theme_base_color; + background-color: @view_bg_color; border-width: 1px; border-style: solid solid none; border-color: @borders; @@ -93,7 +93,7 @@ } .floating-bar:backdrop { - background-color: @theme_unfocused_base_color; + background-color: @view_bg_color; border-color: @unfocused_borders; } @@ -141,29 +141,18 @@ * horizontal grid lines are enabled, we add them using CSS instead. Exclude the * drop targets to let through the default feedback style. */ .nautilus-list-view .view:not(:drop(active)) { - border-bottom: 1px solid @theme_bg_color; + border-bottom: 1px solid @window_bg_color; } .search-information { - background-color: @theme_selected_bg_color; + background-color: @accent_bg_color; color:white; padding:2px; } -@define-color conflict_bg #fef6b6; - .conflict-row { - background: @conflict_bg; - color: black; -} - -.conflict-row:hover { - background-color: shade(@conflict_bg, 0.9); -} - -.conflict-row:selected { - background: @theme_selected_bg_color; - color: @theme_selected_fg_color; + background: @warning_bg_color; + color: @warning_fg_color; } /* Icon view */ @@ -181,9 +170,9 @@ flowboxchild:selected { flowboxchild .thumbnail { margin: 4px; - box-shadow: 0px 1px 2px 0px alpha(@borders, 0.5), - 0px 0px 0px 1px alpha(@borders, 0.5), - 0px 2px 0px 0px alpha(@borders, 0.5); + box-shadow: 0px 1px 2px 0px @shade_color, + 0px 0px 0px 1px @shade_color, + 0px 2px 0px 0px @shade_color; border-radius: 2px; } @@ -193,11 +182,11 @@ flowboxchild .thumbnail { } flowboxchild:selected .icon-ui-labels-box { - color: @theme_selected_fg_color; - background-color: @theme_selected_bg_color; + background-color: @accent_bg_color; + color: @accent_fg_color; } flowboxchild:selected image { -gtk-icon-filter: opacity(0.5); - -gtk-icon-shadow: 0px 0px @theme_selected_bg_color; + -gtk-icon-shadow: 0px 0px @accent_bg_color; } -- GitLab From 25f65bcef7ef63152fcbab3cb849ae6afbd57d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Sun, 2 Jan 2022 12:41:05 +0000 Subject: [PATCH 08/13] properties-window: Set Image pixel size GtkImage no longer sets an icon size on construction. Set a pixel size which matches the intrinsic size of the paintable. --- src/nautilus-properties-window.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c index a359a21018..6050683f28 100644 --- a/src/nautilus-properties-window.c +++ b/src/nautilus-properties-window.c @@ -456,6 +456,7 @@ update_properties_window_icon (NautilusPropertiesWindow *self) { g_autoptr (GdkPaintable) paintable = NULL; g_autofree char *name = NULL; + gint pixel_size; get_image_for_properties_window (self, &name, &paintable); @@ -464,8 +465,13 @@ update_properties_window_icon (NautilusPropertiesWindow *self) gtk_window_set_icon_name (GTK_WINDOW (self), name); } + pixel_size = MAX (gdk_paintable_get_intrinsic_width (paintable), + gdk_paintable_get_intrinsic_width (paintable)); + gtk_image_set_from_paintable (GTK_IMAGE (self->icon_image), paintable); gtk_image_set_from_paintable (GTK_IMAGE (self->icon_button_image), paintable); + gtk_image_set_pixel_size (GTK_IMAGE (self->icon_image), pixel_size); + gtk_image_set_pixel_size (GTK_IMAGE (self->icon_button_image), pixel_size); } #if 0 && NAUTILUS_DND_NEEDS_GTK4_REIMPLEMENTATION -- GitLab From 139becae908fce7dfdf14cc052c1d83b69b1a9c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Fri, 24 Dec 2021 00:07:17 +0000 Subject: [PATCH 09/13] view-icon-item-ui: Use GtkPicture instead of GtkImage GtkImage is simpler now and doesn't have some features we rely on for the grid view. Instead, we should use the new GtkPicture to get the expected results. But -gtk-icon-filter CSS extensions don't work on GtkPicture. Instead, use a filter to achieve a similar visual result. --- src/nautilus-view-icon-item-ui.c | 2 +- src/resources/css/Adwaita.css | 5 ++--- src/resources/ui/nautilus-view-icon-item-ui.ui | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nautilus-view-icon-item-ui.c b/src/nautilus-view-icon-item-ui.c index 344e0fc2a0..8bb1e2abe6 100644 --- a/src/nautilus-view-icon-item-ui.c +++ b/src/nautilus-view-icon-item-ui.c @@ -47,7 +47,7 @@ update_icon (NautilusViewIconItemUi *self) NAUTILUS_FILE_ICON_FLAGS_USE_ONE_EMBLEM; icon_paintable = nautilus_file_get_icon_paintable (file, icon_size, 1, flags); - gtk_image_set_from_paintable (GTK_IMAGE (self->icon), icon_paintable); + gtk_picture_set_paintable (GTK_PICTURE (self->icon), icon_paintable); gtk_widget_set_size_request (self->fixed_height_box, icon_size, icon_size); if (icon_size < NAUTILUS_GRID_ICON_SIZE_LARGEST) diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css index 7c4d687e4c..a05f44e27a 100644 --- a/src/resources/css/Adwaita.css +++ b/src/resources/css/Adwaita.css @@ -186,7 +186,6 @@ flowboxchild:selected .icon-ui-labels-box { color: @accent_fg_color; } -flowboxchild:selected image { - -gtk-icon-filter: opacity(0.5); - -gtk-icon-shadow: 0px 0px @accent_bg_color; +flowboxchild:selected picture { + filter: sepia(1.5) hue-rotate(180deg) brightness(0.5) saturate(2.0); } diff --git a/src/resources/ui/nautilus-view-icon-item-ui.ui b/src/resources/ui/nautilus-view-icon-item-ui.ui index fa1fe25e10..624a5a1780 100644 --- a/src/resources/ui/nautilus-view-icon-item-ui.ui +++ b/src/resources/ui/nautilus-view-icon-item-ui.ui @@ -17,11 +17,12 @@ center 96 - + center True end True + False -- GitLab From 098f6a43d782e7791caa4c443f6ab08a1310f4a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Sat, 1 Jan 2022 01:49:55 +0000 Subject: [PATCH 10/13] view-icon-item-ui: Use .caption style for captions Instead of .dim-label. --- src/resources/ui/nautilus-view-icon-item-ui.ui | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/resources/ui/nautilus-view-icon-item-ui.ui b/src/resources/ui/nautilus-view-icon-item-ui.ui index 624a5a1780..7ec4eb839a 100644 --- a/src/resources/ui/nautilus-view-icon-item-ui.ui +++ b/src/resources/ui/nautilus-view-icon-item-ui.ui @@ -57,7 +57,7 @@ word-char start @@ -71,7 +71,7 @@ word-char start @@ -85,7 +85,7 @@ word-char start -- GitLab From b84805cb9ec7c68aef010820787e99d5889c1059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Thu, 23 Dec 2021 17:04:24 +0000 Subject: [PATCH 11/13] toolbar: Update visual design Use AdwSplit button and drop linked box for nav buttons. Use .spacer separator instead of css margin. --- src/nautilus-toolbar.c | 10 +- src/resources/css/Adwaita.css | 5 - src/resources/ui/nautilus-toolbar.ui | 188 ++++++++++++--------------- 3 files changed, 85 insertions(+), 118 deletions(-) diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c index 670508933f..835d8add13 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 a05f44e27a..4edefa2067 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 e9a1010298..1397646123 100644 --- a/src/resources/ui/nautilus-toolbar.ui +++ b/src/resources/ui/nautilus-toolbar.ui @@ -130,7 +130,6 @@ False - 270 6 @@ -191,137 +190,112 @@ - + + True + Go back + center + center + win.back - - True - Go back - center - center - win.back - - - go-previous-symbolic - 1 - - - + + go-previous-symbolic + 1 + + + + + + True + Go forward + center + center + win.forward - - True - Go forward - center - center - win.forward - - - go-next-symbolic - 1 - - - + + go-next-symbolic + 1 + + + + + - - 72 + + True + center + center + app_menu - - center - center - slide-right - - - True - Show operations - 6 - operations_popover - - - 16 - 16 - center - center - - - - - + + open-menu-symbolic + 1 + + + + + + center + center + 6 + True + Toggle view + slot.files-view-mode-toggle + view_menu - - center - center - 6 - - - True - Toggle view - slot.files-view-mode-toggle - - - 1 - - - - - - - - True - True - View options - start - view_menu - - - pan-down-symbolic - - - - - - + + 1 - - + + + + + center + center + slide-right + + True - center - center - app_menu + Show operations + 6 + operations_popover - - open-menu-symbolic - 1 + + 16 + 16 + center + center - + + + + + + -- GitLab From e4376e7f527f587f78b25acf62c3bee42a541288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Fri, 24 Dec 2021 05:00:17 +0000 Subject: [PATCH 12/13] files-view: Drop arrow from background context menu It doesn't have an specific target to point to. --- src/nautilus-files-view.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index c815e8c742..eb07d9f952 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -8316,6 +8316,8 @@ nautilus_files_view_pop_up_background_context_menu (NautilusFilesView *view, { priv->background_menu = gtk_popover_menu_new_from_model (NULL); gtk_widget_set_parent (priv->background_menu, GTK_WIDGET (view)); + gtk_popover_set_has_arrow (GTK_POPOVER (priv->background_menu), FALSE); + gtk_widget_set_halign (priv->background_menu, GTK_ALIGN_START); g_signal_connect (priv->background_menu, "destroy", G_CALLBACK (gtk_widget_unparent), NULL); } gtk_popover_menu_set_menu_model (GTK_POPOVER_MENU (priv->background_menu), -- GitLab From fd47742babfae904231efc7cb0d99afce5d37418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Thu, 23 Dec 2021 17:35:23 +0000 Subject: [PATCH 13/13] query-editor: Restore type-to-search Use a temporary hack to fix the regression. It makes assumptions about the internals of GtkEntry, which are subject to change. We can drop this hack later, when we have custom tagged search entry. --- src/nautilus-query-editor.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/nautilus-query-editor.c b/src/nautilus-query-editor.c index 15bcd1f57e..98d69f3b0f 100644 --- a/src/nautilus-query-editor.c +++ b/src/nautilus-query-editor.c @@ -795,6 +795,7 @@ nautilus_query_editor_handle_event (NautilusQueryEditor *self, guint keyval, GdkModifierType state) { + GtkWidget *text; g_return_val_if_fail (NAUTILUS_IS_QUERY_EDITOR (self), GDK_EVENT_PROPAGATE); g_return_val_if_fail (controller != NULL, GDK_EVENT_PROPAGATE); @@ -806,5 +807,19 @@ nautilus_query_editor_handle_event (NautilusQueryEditor *self, return GDK_EVENT_PROPAGATE; } - return gtk_event_controller_key_forward (controller, GTK_WIDGET (self->entry)); + text = gtk_widget_get_first_child (GTK_WIDGET (self->entry)); + while (text != NULL) + { + if (GTK_IS_TEXT (text)) + { + break; + } + text = gtk_widget_get_next_sibling (text); + } + + if (text == NULL) + { + return FALSE; + } + return gtk_event_controller_key_forward (controller, text); } -- GitLab