From 97933849f4d57d53477d948e8c294208b9a55ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Mon, 10 Oct 2022 16:46:03 +0200 Subject: [PATCH] room-history: Fix width of locations in replies --- .../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 fc875d73..4499947d 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); + } } }