[gtk/list-widget-styles: 1/3] Change css names of list widget



commit f9287941b49897a50aecaa8a505c4b3b66cdfac6
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jun 4 08:42:55 2020 -0400

    Change css names of list widget
    
    The new names are
    
    GtkListView - listview row
    GtkGridView - gridview child
    GtkColumView - columnview header
                   columnview listview row
    
    Adwaita css has been updated to preserve
    existing styles.
    
    Fixes: #2818

 gtk/gtkcolumnview.c            |  2 +-
 gtk/gtkgridview.c              |  4 ++--
 gtk/gtklistview.c              |  2 +-
 gtk/theme/Adwaita/_common.scss | 19 +++++++++++++++++++
 4 files changed, 23 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkcolumnview.c b/gtk/gtkcolumnview.c
index e7ef11d797..0ff4ef82d2 100644
--- a/gtk/gtkcolumnview.c
+++ b/gtk/gtkcolumnview.c
@@ -653,7 +653,7 @@ gtk_column_view_class_init (GtkColumnViewClass *klass)
                               G_TYPE_FROM_CLASS (gobject_class),
                               g_cclosure_marshal_VOID__UINTv);
 
-  gtk_widget_class_set_css_name (widget_class, I_("treeview"));
+  gtk_widget_class_set_css_name (widget_class, I_("columnview"));
 }
 
 static void update_column_resize  (GtkColumnView *self,
diff --git a/gtk/gtkgridview.c b/gtk/gtkgridview.c
index f6b93b3dec..d16357a17b 100644
--- a/gtk/gtkgridview.c
+++ b/gtk/gtkgridview.c
@@ -992,7 +992,7 @@ gtk_grid_view_class_init (GtkGridViewClass *klass)
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-  list_base_class->list_item_name = "flowboxchild";
+  list_base_class->list_item_name = "child";
   list_base_class->list_item_size = sizeof (Cell);
   list_base_class->list_item_augment_size = sizeof (CellAugment);
   list_base_class->list_item_augment_func = cell_augment;
@@ -1123,7 +1123,7 @@ gtk_grid_view_class_init (GtkGridViewClass *klass)
                                    "u",
                                    gtk_grid_view_activate_item);
 
-  gtk_widget_class_set_css_name (widget_class, I_("flowbox"));
+  gtk_widget_class_set_css_name (widget_class, I_("gridview"));
 }
 
 static void
diff --git a/gtk/gtklistview.c b/gtk/gtklistview.c
index 90b594da30..8688472e0a 100644
--- a/gtk/gtklistview.c
+++ b/gtk/gtklistview.c
@@ -832,7 +832,7 @@ gtk_list_view_class_init (GtkListViewClass *klass)
                                    "u",
                                    gtk_list_view_activate_item);
 
-  gtk_widget_class_set_css_name (widget_class, I_("list"));
+  gtk_widget_class_set_css_name (widget_class, I_("listview"));
 }
 
 static void
diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss
index 7314efa8d2..6ca74d3c7e 100644
--- a/gtk/theme/Adwaita/_common.scss
+++ b/gtk/theme/Adwaita/_common.scss
@@ -123,6 +123,23 @@ flowbox {
   }
 }
 
+gridview {
+  > rubberband { @extend rubberband; }
+
+  > child {
+    padding: 3px;
+    transition: $focus_transition;
+
+    @include focus-ring();
+
+    &:selected {
+      outline-color: $alt_focus_border_color;
+
+      @extend %selected_items;
+    }
+  }
+}
+
 coverflow cover {
   color: $text_color;
   background-color: $base_color;
@@ -1512,6 +1529,7 @@ pathbar > button {
 
 $_treeview_borders_color: if($variant=='light',mix($borders_color, $base_color,80%),mix($fg_color, 
$base_color, 20%));
 $_treeview_backdrop_borders_color: if($variant=='light',mix($backdrop_borders_color, $base_color, 
80%),mix($backdrop_fg_color, $base_color, 20%));
+columnview.view,
 treeview.view {
   border-left-color:  $_treeview_borders_color; // this is actually the tree lines color,
   border-top-color: $_treeview_borders_color;                         // while this is the grid lines color, 
better then nothing
@@ -2977,6 +2995,7 @@ separator {
 /*********
  * Lists *
  *********/
+listview,
 list {
   color: $text_color;
   background-color: $base_color;


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