[libadwaita/wip/exalm/exclusive-toggles: 2/3] stylesheet: Use exclusive toggle style for GtkStackSwitcher




commit 7594284eea5563d3a327c336afbc3c219cc2c7e6
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sun Sep 12 00:26:03 2021 +0500

    stylesheet: Use exclusive toggle style for GtkStackSwitcher

 src/stylesheet/widgets/_buttons.scss           | 21 -------------------
 src/stylesheet/widgets/_exclusive-toggles.scss | 28 ++++++++++++++++++++++++++
 src/stylesheet/widgets/_toolbars.scss          |  9 ++++++---
 3 files changed, 34 insertions(+), 24 deletions(-)
---
diff --git a/src/stylesheet/widgets/_buttons.scss b/src/stylesheet/widgets/_buttons.scss
index c56d97ce..ebc978a0 100644
--- a/src/stylesheet/widgets/_buttons.scss
+++ b/src/stylesheet/widgets/_buttons.scss
@@ -240,27 +240,6 @@ button {
     }
   }
 
-  stackswitcher > & {
-    // to position the needs attention dot, padding is added to the button
-    // child, a label needs just lateral padding while an icon needs vertical
-    // padding added too.
-
-    > label {
-      padding: 0 6px;
-      margin: 0 -6px;
-    }
-
-    > image {
-      padding: 3px 6px;
-      margin: -3px -6px;
-    }
-
-    &.needs-attention {
-      > label,
-      > image { @extend %needs_attention; }
-    }
-  }
-
   // hide separators
   &.font {
     separator { background-color: transparent; }
diff --git a/src/stylesheet/widgets/_exclusive-toggles.scss b/src/stylesheet/widgets/_exclusive-toggles.scss
index 4ec5b14c..2d2f50f2 100644
--- a/src/stylesheet/widgets/_exclusive-toggles.scss
+++ b/src/stylesheet/widgets/_exclusive-toggles.scss
@@ -1,3 +1,4 @@
+stackswitcher,
 .exclusive {
   background-color: gtkalpha(currentColor, .1);
   padding: 3px;
@@ -49,3 +50,30 @@
     }
   }
 }
+
+/********************
+ * GtkStackSwitcher *
+ ********************/
+
+stackswitcher {
+  > button {
+    // to position the needs attention dot, padding is added to the button
+    // child, a label needs just lateral padding while an icon needs vertical
+    // padding added too.
+
+    > label {
+      padding: 0 6px;
+      margin: 0 -6px;
+    }
+
+    > image {
+      padding: 3px 6px;
+      margin: -3px -6px;
+    }
+
+    &.needs-attention {
+      > label,
+      > image { @extend %needs_attention; }
+    }
+  }
+}
diff --git a/src/stylesheet/widgets/_toolbars.scss b/src/stylesheet/widgets/_toolbars.scss
index bbb78720..f8c49243 100644
--- a/src/stylesheet/widgets/_toolbars.scss
+++ b/src/stylesheet/widgets/_toolbars.scss
@@ -24,7 +24,8 @@
     }
   }
 
-  .exclusive {
+  .exclusive,
+  stackswitcher {
     button:not(.raised):not(.suggested-action):not(.destructive-action).toggle {
       &.arrow-button,
       &.image-button,
@@ -79,7 +80,8 @@
     margin-bottom: 10px;
   }
 
-  .exclusive {
+  .exclusive,
+  stackswitcher {
     margin-top: 6px;
     margin-bottom: 6px;
 
@@ -112,7 +114,8 @@
     button,
     menubutton,
     switch,
-    .exclusive {
+    .exclusive,
+    stackswitcher {
       margin-top: 0;
       margin-bottom: 0;
     }


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