room-history: Fix width of locations in replies

This commit is contained in:
Kévin Commaille 2022-10-10 16:46:03 +02:00
parent 19d5f87e48
commit 97933849f4
No known key found for this signature in database
GPG key ID: DD507DAE96E8245C

View file

@ -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);
}
}
}