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




commit 7f28532f9153eaad3180dbf4707420ddb1fc91ca
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       | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-view-icon-controller.c b/src/nautilus-view-icon-controller.c
index 51ff19df6..6e78fe3b5 100644
--- a/src/nautilus-view-icon-controller.c
+++ b/src/nautilus-view-icon-controller.c
@@ -1345,6 +1345,7 @@ create_view_ui (NautilusViewIconController *self)
     gtk_flow_box_set_column_spacing (flowbox, 6);
     gtk_flow_box_set_row_spacing (flowbox, 6);
 
+    gtk_widget_add_css_class (widget, "nautilus-grid-view");
     return flowbox;
 }
 
diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css
index 206777b88..565ccaa50 100644
--- a/src/resources/css/Adwaita.css
+++ b/src/resources/css/Adwaita.css
@@ -150,12 +150,12 @@
     color: @warning_fg_color;
 }
 
-/* Icon view */
-flowbox {
+/* Grid view */
+.nautilus-grid-view {
   padding: 18px;
 }
 
-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]