[libadwaita/wip/exalm/monospace: 3/3] stylesheet: Support .monospace for entry rows




commit 962938eb9d8db5760b5d337ea8adc3cf7b5d0f26
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Apr 27 13:17:23 2022 +0400

    stylesheet: Support .monospace for entry rows
    
    Fixes https://gitlab.gnome.org/GNOME/libadwaita/-/issues/464

 doc/style-classes.md               | 4 ++++
 src/stylesheet/widgets/_lists.scss | 8 ++++++++
 2 files changed, 12 insertions(+)
---
diff --git a/doc/style-classes.md b/doc/style-classes.md
index 5e1153e9..776ee2fc 100644
--- a/doc/style-classes.md
+++ b/doc/style-classes.md
@@ -298,6 +298,10 @@ the regular body style.
 The `.monospace` style class makes the widget use a monospace font. This can be
 useful when displaying code, logs or shell commands.
 
+For [class@EntryRow], it only makes the editable part monospace, but not title
+or any extra widgets. To make everything in the row monospace, apply
+`.monospace` to the [class@Gtk.ListBox] around the row.
+
 <picture>
   <source srcset="typography-numeric-dark.png" media="(prefers-color-scheme: dark)">
   <img src="typography-numeric.png" alt="typography-numeric">
diff --git a/src/stylesheet/widgets/_lists.scss b/src/stylesheet/widgets/_lists.scss
index 0bf07135..290cc398 100644
--- a/src/stylesheet/widgets/_lists.scss
+++ b/src/stylesheet/widgets/_lists.scss
@@ -136,6 +136,14 @@ row.entry {
   .indicator {
     opacity: $dimmer_opacity;
   }
+
+  &.monospace {
+    font-family: inherit;
+
+    text {
+      font-family: monospace;
+    }
+  }
 }
 
 /***************


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