[libadwaita/wip/exalm/common-classes] stylesheet: Add and use .numeric




commit 56d6755eb46cd7065adb77989a5de1ca218ec9ea
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Aug 4 16:50:42 2021 +0500

    stylesheet: Add and use .numeric
    
    Have an easy way to apply tnum to labels.

 src/adw-indicator-bin.c                    | 1 +
 src/stylesheet/widgets/_labels.scss        | 4 ++++
 src/stylesheet/widgets/_progress-bar.scss  | 2 +-
 src/stylesheet/widgets/_scale.scss         | 4 ++--
 src/stylesheet/widgets/_spin-button.scss   | 3 +--
 src/stylesheet/widgets/_view-switcher.scss | 1 -
 6 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/adw-indicator-bin.c b/src/adw-indicator-bin.c
index b3284768..050edfce 100644
--- a/src/adw-indicator-bin.c
+++ b/src/adw-indicator-bin.c
@@ -343,6 +343,7 @@ adw_indicator_bin_init (AdwIndicatorBin *self)
   self->label = gtk_label_new (NULL);
   gtk_widget_set_visible (self->label, FALSE);
   gtk_widget_set_parent (self->label, self->indicator);
+  gtk_widget_add_css_class (self->label, "numeric");
 }
 
 static void
diff --git a/src/stylesheet/widgets/_labels.scss b/src/stylesheet/widgets/_labels.scss
index 8f972afe..acee8660 100644
--- a/src/stylesheet/widgets/_labels.scss
+++ b/src/stylesheet/widgets/_labels.scss
@@ -75,6 +75,10 @@ label {
   font-family: monospace;
 }
 
+.numeric {
+  font-feature-settings: "tnum";
+}
+
 /*******************
  * Editable Labels *
  *******************/
diff --git a/src/stylesheet/widgets/_progress-bar.scss b/src/stylesheet/widgets/_progress-bar.scss
index 9a758bdd..8cbd0c81 100644
--- a/src/stylesheet/widgets/_progress-bar.scss
+++ b/src/stylesheet/widgets/_progress-bar.scss
@@ -16,8 +16,8 @@ progressbar {
 
   > text {
     @extend .dim-label;
+    @extend .numeric;
     font-size: smaller;
-    font-feature-settings: "tnum";
   }
 
   &:disabled {
diff --git a/src/stylesheet/widgets/_scale.scss b/src/stylesheet/widgets/_scale.scss
index dd790b70..d722f826 100644
--- a/src/stylesheet/widgets/_scale.scss
+++ b/src/stylesheet/widgets/_scale.scss
@@ -108,8 +108,8 @@ scale {
   }
 
   > value {
-    color: gtkalpha(currentColor, 0.55);
-    font-feature-settings: "tnum";
+    @extend .dim-label;
+    @extend .numeric;
   }
 
   &.marks-before:not(.marks-after),
diff --git a/src/stylesheet/widgets/_spin-button.scss b/src/stylesheet/widgets/_spin-button.scss
index ddcb5620..9a2c5457 100644
--- a/src/stylesheet/widgets/_spin-button.scss
+++ b/src/stylesheet/widgets/_spin-button.scss
@@ -1,5 +1,6 @@
 spinbutton {
   @extend %entry;
+  @extend .numeric;
 
   padding: 0;
   border-spacing: 0;
@@ -80,6 +81,4 @@ spinbutton {
       padding: 1px 2px;
     }
   }
-
-  font-feature-settings: "tnum";
 }
diff --git a/src/stylesheet/widgets/_view-switcher.scss b/src/stylesheet/widgets/_view-switcher.scss
index afbeff44..c690dd31 100644
--- a/src/stylesheet/widgets/_view-switcher.scss
+++ b/src/stylesheet/widgets/_view-switcher.scss
@@ -81,7 +81,6 @@ indicatorbin {
       font-weight: bold;
       padding: 1px 4px;
       color: white;
-      font-feature-settings: "tnum";
     }
   }
 


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