[fractal] room-history: Fix width of locations in replies



commit 97933849f4d57d53477d948e8c294208b9a55ae8
Author: Kévin Commaille <zecakeh tedomum fr>
Date:   Mon Oct 10 16:46:03 2022 +0200

    room-history: Fix width of locations in replies

 src/session/content/room_history/message_row/location.rs | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/session/content/room_history/message_row/location.rs 
b/src/session/content/room_history/message_row/location.rs
index fc875d739..4499947db 100644
--- a/src/session/content/room_history/message_row/location.rs
+++ b/src/session/content/room_history/message_row/location.rs
@@ -89,13 +89,11 @@ impl MessageLocation {
 
     pub fn set_geo_uri(&self, uri: &str, format: ContentFormat) {
         let priv_ = self.imp();
+        let compact = matches!(format, ContentFormat::Compact | ContentFormat::Ellipsized);
+        priv_.location.set_compact(compact);
 
         match GeoUri::parse(uri) {
             Ok(geo_uri) => {
-                priv_.location.set_compact(matches!(
-                    format,
-                    ContentFormat::Compact | ContentFormat::Ellipsized
-                ));
                 priv_.location.set_location(&geo_uri);
                 priv_.overlay_error.hide();
             }
@@ -108,5 +106,11 @@ impl MessageLocation {
                 priv_.overlay_error.show();
             }
         };
+
+        if compact {
+            self.set_halign(gtk::Align::Start);
+        } else {
+            self.set_halign(gtk::Align::Fill);
+        }
     }
 }


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