[nautilus/wip/antoniof/flowbox-to-gridview: 11/24] view-icon-controller: Add style class




commit 4eb8d7b73bf041f5195ad22b57d1ce8c75a37b5e
Author: António Fernandes <antoniof gnome org>
Date:   Sun Jan 23 21:14:58 2022 +0000

    view-icon-controller: Add style class
    
    Our custom CSS relies on `flowbox` and `flowboxchild`. But GtkFlowBox
    is about to be replaced with GtkGridView. Also, it may happen that
    we use either widget in other contexts in this app in the future, so
    it's best to be more specific on where we want the styles to apply.

 src/nautilus-view-icon-controller.c | 1 +
 src/resources/css/Adwaita.css       | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-view-icon-controller.c b/src/nautilus-view-icon-controller.c
index 51ff19df6..b087333b5 100644
--- a/src/nautilus-view-icon-controller.c
+++ b/src/nautilus-view-icon-controller.c
@@ -1479,6 +1479,7 @@ static void
 nautilus_view_icon_controller_init (NautilusViewIconController *self)
 {
     gtk_widget_add_css_class (GTK_WIDGET (self), "view");
+    gtk_widget_add_css_class (GTK_WIDGET (self), "nautilus-grid-view");
     set_click_mode_from_settings (self);
 
     g_signal_connect_swapped (nautilus_preferences,
diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css
index 987088223..b201c9ac9 100644
--- a/src/resources/css/Adwaita.css
+++ b/src/resources/css/Adwaita.css
@@ -150,16 +150,16 @@
     color: @warning_fg_color;
 }
 
-/* Icon view */
-flowbox {
+/* Grid view */
+.nautilus-grid-view flowbox {
   padding: 18px;
 }
 
-flowbox flowboxchild {
+.nautilus-grid-view flowboxchild {
   padding: 6px;
 }
 
-flowboxchild .thumbnail {
+.nautilus-grid-view .thumbnail {
   box-shadow: 0px 1px 2px 0px @shade_color,
               0px 0px 0px 1px @shade_color,
               0px 2px 0px 0px @shade_color;


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