[gnome-software: 1/2] style: Make the section styling more versatile




commit e94bcfa2a56c7a8a165c434e75b5abdc65a19e2e
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Jul 21 13:29:33 2021 +0200

    style: Make the section styling more versatile
    
    This replaces some rigid hierarchy with the .section style class, making
    reusing the style easier.

 src/gs-installed-page.ui | 12 ++++++++++++
 src/gs-search-page.ui    |  1 +
 src/gtk-style.css        | 12 ++++--------
 3 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/src/gs-installed-page.ui b/src/gs-installed-page.ui
index 7f0f9cb5c..b3357e3ac 100644
--- a/src/gs-installed-page.ui
+++ b/src/gs-installed-page.ui
@@ -50,6 +50,9 @@
                           <object class="HdyPreferencesGroup" id="group_install_in_progress">
                             <property name="visible">False</property>
                             <property name="title" translatable="yes">In Progress</property>
+                            <style>
+                              <class name="section"/>
+                            </style>
                             <child>
                               <object class="GtkListBox" id="list_box_install_in_progress">
                                 <property name="visible">True</property>
@@ -69,6 +72,9 @@
                           <object class="HdyPreferencesGroup" id="group_install_apps">
                             <property name="visible">False</property>
                             <property name="title" translatable="yes">Applications</property>
+                            <style>
+                              <class name="section"/>
+                            </style>
                             <child>
                               <object class="GtkListBox" id="list_box_install_apps">
                                 <property name="visible">True</property>
@@ -88,6 +94,9 @@
                           <object class="HdyPreferencesGroup" id="group_install_system_apps">
                             <property name="visible">False</property>
                             <property name="title" translatable="yes">System Applications</property>
+                            <style>
+                              <class name="section"/>
+                            </style>
                             <child>
                               <object class="GtkListBox" id="list_box_install_system_apps">
                                 <property name="visible">True</property>
@@ -107,6 +116,9 @@
                           <object class="HdyPreferencesGroup" id="group_install_addons">
                             <property name="visible">False</property>
                             <property name="title" translatable="yes">Add-ons</property>
+                            <style>
+                              <class name="section"/>
+                            </style>
                             <child>
                               <object class="GtkListBox" id="list_box_install_addons">
                                 <property name="visible">True</property>
diff --git a/src/gs-search-page.ui b/src/gs-search-page.ui
index efe9848d6..6901a7c2f 100644
--- a/src/gs-search-page.ui
+++ b/src/gs-search-page.ui
@@ -89,6 +89,7 @@
                     <property name="can_focus">True</property>
                     <property name="selection_mode">none</property>
                     <style>
+                      <class name="section"/>
                       <class name="content"/>
                     </style>
                   </object>
diff --git a/src/gtk-style.css b/src/gtk-style.css
index fb74c8234..bee2b1090 100644
--- a/src/gtk-style.css
+++ b/src/gtk-style.css
@@ -541,8 +541,7 @@ scrolledwindow.list-page > viewport > clamp {
   margin: 0 12px; transition: margin-bottom 200ms ease;
 }
 
-scrolledwindow.list-page > viewport > clamp > list,
-scrolledwindow.list-page > viewport > clamp > box > preferencesgroup {
+scrolledwindow.list-page > viewport > clamp .section {
   transition: margin-top 200ms ease;
 }
 
@@ -550,8 +549,7 @@ scrolledwindow.list-page > viewport > clamp.small {
   margin-bottom: 18px;
 }
 
-scrolledwindow.list-page > viewport > clamp.small > list,
-scrolledwindow.list-page > viewport > clamp.small > box > preferencesgroup {
+scrolledwindow.list-page > viewport > clamp.small .section {
   margin-top: 18px;
 }
 
@@ -559,8 +557,7 @@ scrolledwindow.list-page > viewport > clamp.medium {
   margin-bottom: 24px;
 }
 
-scrolledwindow.list-page > viewport > clamp.medium > list,
-scrolledwindow.list-page > viewport > clamp.medium > box > preferencesgroup {
+scrolledwindow.list-page > viewport > clamp.medium .section {
   margin-top: 24px;
 }
 
@@ -568,8 +565,7 @@ scrolledwindow.list-page > viewport > clamp.large {
   margin-bottom: 30px;
 }
 
-scrolledwindow.list-page > viewport > clamp.large > list,
-scrolledwindow.list-page > viewport > clamp.large > box > preferencesgroup {
+scrolledwindow.list-page > viewport > clamp.large .section {
   margin-top: 30px;
 }
 


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