[fractal] room-history: Increase message line height



commit 546dae1e4f4ab1fd00a74345274d9806ddf86503
Author: Harshil Patel <harshilpatel1973 gmail com>
Date:   Mon Aug 29 20:22:17 2022 +0530

    room-history: Increase message line height
    
    Unfortuntely line height on multi-height labels is way too tight by default in GTK4, so we need to work 
around it in apps.
    One very visible instance of this is the message bodies in the timeline.
    
    I fixed issue by adding css line-height property on .room-history row css class.
    
    https://gitlab.gnome.org/GNOME/fractal/-/issues/1030
    
    Part-of: <https://gitlab.gnome.org/GNOME/fractal/-/merge_requests/1141>

 data/resources/style.css             | 4 ++++
 src/components/label_with_widgets.rs | 1 +
 2 files changed, 5 insertions(+)
---
diff --git a/data/resources/style.css b/data/resources/style.css
index 43f83b241..85926f26e 100644
--- a/data/resources/style.css
+++ b/data/resources/style.css
@@ -9,6 +9,10 @@ textview, text {
   font-weight: bold;
 }
 
+.line-height {
+  line-height: 150%;
+}
+
 button.pill.large {
   padding: 12px 40px;
 }
diff --git a/src/components/label_with_widgets.rs b/src/components/label_with_widgets.rs
index aa889388e..b13dd95e2 100644
--- a/src/components/label_with_widgets.rs
+++ b/src/components/label_with_widgets.rs
@@ -96,6 +96,7 @@ mod imp {
             label.set_wrap_mode(pango::WrapMode::WordChar);
             label.set_xalign(0.0);
             label.set_valign(gtk::Align::Start);
+            label.add_css_class("line-height");
             label.connect_notify_local(
                 Some("label"),
                 clone!(@weak obj => move |_, _| {


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