[libadwaita/wip/exalm/stylesheet2: 81/103] stylesheet: Split progress bar styles into a separate file




commit da05cdfc1f8abef6251458d6a54a0b29edb0db0a
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri Apr 9 13:31:12 2021 +0500

    stylesheet: Split progress bar styles into a separate file

 src/stylesheet/_common.scss               | 83 -------------------------------
 src/stylesheet/_widgets.scss              |  1 +
 src/stylesheet/meson.build                |  1 +
 src/stylesheet/widgets/_progress-bar.scss | 79 +++++++++++++++++++++++++++++
 4 files changed, 81 insertions(+), 83 deletions(-)
---
diff --git a/src/stylesheet/_common.scss b/src/stylesheet/_common.scss
index bc75985..51067be 100644
--- a/src/stylesheet/_common.scss
+++ b/src/stylesheet/_common.scss
@@ -237,89 +237,6 @@ editablelabel > stack > text {
 }
 
 
-/*****************
- * Progress bars *
- *****************/
-progressbar {
-  // sizing
-  &.horizontal {
-    > trough {
-      min-width: 150px;
-      &, > progress { min-height: 2px; }
-    }
-  }
-
-  &.vertical {
-    > trough {
-      min-height: 80px;
-      &, > progress { min-width: 2px; }
-    }
-  }
-
-  &.horizontal > trough > progress { margin: 0 -1px; } // the progress node is positioned after the trough 
border
-  &.vertical > trough > progress { margin: -1px 0; }   // this moves it over it.
-
-  // FIXME: insensitive state missing and some other state should be set probably
-  font-size: smaller;
-  color: transparentize($fg_color, 0.6);
-  font-feature-settings: "tnum";
-
-  > trough {
-    @extend %scale_trough;
-
-    > progress {
-      @extend %scale_highlight; /* share most of scales' */
-      /* override insensitive that is specific to progress */
-      &:disabled {
-        background-color: $insensitive_fg_color;
-        border-color: $insensitive_fg_color;
-      }
-
-      border-radius: 1.5px;
-      $_progress-radius: 5px;
-      &.left {
-        border-top-left-radius: $_progress-radius;
-        border-bottom-left-radius: $_progress-radius;
-      }
-
-      &.right {
-        border-top-right-radius: $_progress-radius;
-        border-bottom-right-radius: $_progress-radius;
-      }
-
-      &.top {
-        border-top-right-radius: $_progress-radius;
-        border-top-left-radius: $_progress-radius;
-      }
-
-      &.bottom {
-        border-bottom-right-radius: $_progress-radius;
-        border-bottom-left-radius: $_progress-radius;
-      }
-    }
-  }
-
-  &.osd { // progressbar.osd used for epiphany page loading progress
-    min-width: 3px;
-    min-height: 3px;
-    background-color: transparent;
-
-    > trough {
-      border-style: none;
-      border-radius: 0;
-      background-color: transparent;
-      box-shadow: none;
-
-      > progress {
-        border-style: none;
-        border-radius: 0;
-      }
-    }
-  }
-
-  > trough.empty > progress { all: unset; } // makes the progress indicator disappear, when the fraction is 0
-}
-
 /*************
  * Level Bar *
  *************/
diff --git a/src/stylesheet/_widgets.scss b/src/stylesheet/_widgets.scss
index a064161..1b2654b 100644
--- a/src/stylesheet/_widgets.scss
+++ b/src/stylesheet/_widgets.scss
@@ -7,6 +7,7 @@
 @import 'widgets/menus';
 @import 'widgets/notebook';
 @import 'widgets/popovers';
+@import 'widgets/progress-bar';
 @import 'widgets/scale';
 @import 'widgets/scrolling';
 @import 'widgets/spinner';
diff --git a/src/stylesheet/meson.build b/src/stylesheet/meson.build
index a5aa33e..2364bac 100644
--- a/src/stylesheet/meson.build
+++ b/src/stylesheet/meson.build
@@ -29,6 +29,7 @@ if not fs.exists('Adwaita-light.css')
       'widgets/_menus.scss',
       'widgets/_notebook.scss',
       'widgets/_popovers.scss',
+      'widgets/_progress-bar.scss',
       'widgets/_scale.scss',
       'widgets/_scrolling.scss',
       'widgets/_spinner.scss',
diff --git a/src/stylesheet/widgets/_progress-bar.scss b/src/stylesheet/widgets/_progress-bar.scss
new file mode 100644
index 0000000..e82e035
--- /dev/null
+++ b/src/stylesheet/widgets/_progress-bar.scss
@@ -0,0 +1,79 @@
+progressbar {
+  // sizing
+  &.horizontal {
+    > trough {
+      min-width: 150px;
+      &, > progress { min-height: 2px; }
+    }
+  }
+
+  &.vertical {
+    > trough {
+      min-height: 80px;
+      &, > progress { min-width: 2px; }
+    }
+  }
+
+  &.horizontal > trough > progress { margin: 0 -1px; } // the progress node is positioned after the trough 
border
+  &.vertical > trough > progress { margin: -1px 0; }   // this moves it over it.
+
+  // FIXME: insensitive state missing and some other state should be set probably
+  font-size: smaller;
+  color: transparentize($fg_color, 0.6);
+  font-feature-settings: "tnum";
+
+  > trough {
+    @extend %scale_trough;
+
+    > progress {
+      @extend %scale_highlight; /* share most of scales' */
+      /* override insensitive that is specific to progress */
+      &:disabled {
+        background-color: $insensitive_fg_color;
+        border-color: $insensitive_fg_color;
+      }
+
+      border-radius: 1.5px;
+      $_progress-radius: 5px;
+      &.left {
+        border-top-left-radius: $_progress-radius;
+        border-bottom-left-radius: $_progress-radius;
+      }
+
+      &.right {
+        border-top-right-radius: $_progress-radius;
+        border-bottom-right-radius: $_progress-radius;
+      }
+
+      &.top {
+        border-top-right-radius: $_progress-radius;
+        border-top-left-radius: $_progress-radius;
+      }
+
+      &.bottom {
+        border-bottom-right-radius: $_progress-radius;
+        border-bottom-left-radius: $_progress-radius;
+      }
+    }
+  }
+
+  &.osd { // progressbar.osd used for epiphany page loading progress
+    min-width: 3px;
+    min-height: 3px;
+    background-color: transparent;
+
+    > trough {
+      border-style: none;
+      border-radius: 0;
+      background-color: transparent;
+      box-shadow: none;
+
+      > progress {
+        border-style: none;
+        border-radius: 0;
+      }
+    }
+  }
+
+  > trough.empty > progress { all: unset; } // makes the progress indicator disappear, when the fraction is 0
+}


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