Commit d4af8fb4 authored by Christopher Davis's avatar Christopher Davis 🌱

Cargo: Update dependencies

The latest version of the libhandy bindings requires an
update to the latest version of the gtk-rs bindings. This
update comes with a few changes, including the removal of the
`Into<Option<T>` pattern in favor of explicitly using `Some(T)` for options.
parent 2158b64a
This diff is collapsed.
......@@ -11,38 +11,38 @@ comrak = "0.4.0"
dirs = "1.0.4"
failure = "0.1.3"
fragile = "0.3.0"
gspell = "0.2.0"
gdk = "0.10.0"
gdk-pixbuf = "0.6.0"
gdk-pixbuf-sys = "0.8.0"
gstreamer-editing-services = "0.13.0"
glib = "0.7.1"
gspell = "0.3.0"
gdk = "0.11.0"
gdk-pixbuf = "0.7.0"
gdk-pixbuf-sys = "0.9.0"
gstreamer-editing-services = "0.14.0"
glib = "0.8.0"
html2pango = "0.3.1"
itertools = "0.8.0"
lazy_static = "1.2.0"
letter-avatar = "1.0.2"
letter-avatar = "1.2.0"
log = "0.4.6"
loggerv = "0.7.1"
mdl = "1.0.4"
pango = "0.6.0"
pangocairo = "0.7.0"
pango = "0.7.0"
pangocairo = "0.8.0"
rand = "0.6.1"
regex = "1.1.0"
secret-service = "1.0.0"
serde_json = "1.0.33"
sourceview = "0.6.0"
sourceview = "0.7.0"
url = "1.7.2"
[dependencies.gst]
version = "0.13.0"
version = "0.14.0"
package = "gstreamer"
[dependencies.gst_player]
version = "0.13.0"
version = "0.14.0"
package = "gstreamer-player"
[dependencies.cairo-rs]
version = "0.6.0"
version = "0.7.0"
features = ["png"]
[dependencies.chrono]
......@@ -54,8 +54,8 @@ path = "../fractal-matrix-api"
package = "fractal-matrix-api"
[dependencies.libhandy]
git = "https://gitlab.gnome.org/World/Rust/libhandy-rs"
features = ["v0_0_9"]
version = "0.4.0"
features = ["v0_0_10"]
[dependencies.gettext-rs]
git = "https://github.com/danigm/gettext-rs"
......@@ -63,7 +63,7 @@ branch = "no-gettext"
features = ["gettext-system"]
[dependencies.gtk]
version = "0.6.0"
version = "0.7.0"
features = ["v3_22"]
[dependencies.serde]
......@@ -71,5 +71,5 @@ version = "1.0.82"
features = ["derive"]
[dependencies.gio]
version = "0.6.0"
version = "0.7.0"
features = ["v2_56"]
......@@ -321,11 +321,11 @@ pub fn new(app: &gtk::Application, op: &Arc<Mutex<AppOp>>) {
//op.lock().unwrap().mark_active_room_messages();
}
fn get_room_id(data: &Option<glib::Variant>) -> Option<&str> {
data.as_ref()?.get_str()
fn get_room_id(data: Option<&glib::Variant>) -> Option<&str> {
data?.get_str()
}
fn get_message(data: &Option<glib::Variant>) -> Option<Message> {
fn get_message(data: Option<&glib::Variant>) -> Option<Message> {
get_message_by_id(data.as_ref()?.get_str()?)
}
......@@ -337,7 +337,7 @@ fn get_message_by_id(id: &str) -> Option<Message> {
op.get_message_by_id(room_id, id)
}
fn open_viewer(data: &Option<glib::Variant>) -> Option<()> {
fn open_viewer(data: Option<&glib::Variant>) -> Option<()> {
let msg = get_message(data)?;
let op = App::get_op()?;
let mut op = op.lock().unwrap();
......
......@@ -69,7 +69,8 @@ pub fn new(
.downcast::<gtk::Window>()
.expect("Could not cast toplevel to GtkWindow");
let uri = globals::RIOT_REGISTER_URL;
if let Err(e) = gtk::show_uri_on_window(&toplevel, uri, gtk::get_current_event_time()) {
if let Err(e) = gtk::show_uri_on_window(Some(&toplevel), uri, gtk::get_current_event_time())
{
warn!("Could not show {}: {}", uri, e)
}
});
......@@ -135,8 +136,8 @@ pub fn new(
})
});
stack.insert_action_group("login", &actions);
headers.insert_action_group("login", &actions);
stack.insert_action_group("login", Some(&actions));
headers.insert_action_group("login", Some(&actions));
actions
}
......@@ -174,8 +174,8 @@ pub fn new(backend: Sender<BKCommand>, ui: UI) -> gio::SimpleActionGroup {
actions
}
fn get_message(data: &Option<glib::Variant>) -> Option<Message> {
get_message_by_id(data.as_ref()?.get_str()?)
fn get_message(data: Option<&glib::Variant>) -> Option<Message> {
get_message_by_id(data?.get_str()?)
}
/* TODO: get message from stroage once implemented */
......@@ -186,7 +186,7 @@ fn get_message_by_id(id: &str) -> Option<Message> {
op.get_message_by_id(room_id, id)
}
fn get_room_id(data: &Option<glib::Variant>) -> Option<String> {
fn get_room_id(data: Option<&glib::Variant>) -> Option<String> {
data.as_ref()?.get_str().map(|s| s.to_string())
}
......
......@@ -82,12 +82,12 @@ impl App {
.builder
.get_object::<gtk::Box>("account_settings_box")
.expect("Can't find account_settings_box in ui file.");
container.insert_action_group("user-settings", &actions);
container.insert_action_group("user-settings", Some(&actions));
/* Body */
if let Some(action) = actions.lookup_action("change-avatar") {
action.bind_button_state(&avatar_btn);
avatar_btn.set_action_name("user-settings.change-avatar");
avatar_btn.set_action_name(Some("user-settings.change-avatar"));
let avatar_spinner = self
.ui
.builder
......
use gtk;
use gtk::BuilderExtManual;
use crate::widgets;
......
......@@ -41,7 +41,7 @@ impl App {
if md_active {
op.lock().unwrap().md_enabled = true;
markdown_switch.set_active(true);
md_img.set_from_icon_name("format-indent-more-symbolic", gtk::IconSize::Menu);
md_img.set_from_icon_name(Some("format-indent-more-symbolic"), gtk::IconSize::Menu);
txt.get_style_context().remove_class("dim-label");
if let Some(md_lang) = md_lang.clone() {
......@@ -58,7 +58,10 @@ impl App {
op.lock().unwrap().md_enabled = markdown_switch.get_active();
if !markdown_switch.get_active() {
md_img.set_from_icon_name("format-justify-left-symbolic", gtk::IconSize::Menu);
md_img.set_from_icon_name(
Some("format-justify-left-symbolic"),
gtk::IconSize::Menu,
);
txt.get_style_context().add_class("dim-label");
util::set_markdown_schema(false);
......@@ -67,13 +70,16 @@ impl App {
buffer.set_language(lang);
buffer.set_highlight_syntax(false);
} else {
md_img.set_from_icon_name("format-indent-more-symbolic", gtk::IconSize::Menu);
md_img.set_from_icon_name(
Some("format-indent-more-symbolic"),
gtk::IconSize::Menu,
);
txt.get_style_context().remove_class("dim-label");
util::set_markdown_schema(true);
if let Some(md_lang) = md_lang.clone() {
buffer.set_highlight_matching_brackets(true);
buffer.set_language(&md_lang);
buffer.set_language(Some(&md_lang));
buffer.set_highlight_syntax(true);
}
}
......
......@@ -106,7 +106,7 @@ impl App {
.builder
.get_object("main_window")
.expect("Couldn't find main_window in ui file.");
window.set_application(gtk_app);
window.set_application(Some(gtk_app));
window.set_title("Fractal");
......
......@@ -17,17 +17,19 @@ impl AppOp {
let program_name = format!("Fractal{}", config::NAME_SUFFIX);
let dialog = gtk::AboutDialog::new();
dialog.set_logo_icon_name(config::APP_ID);
dialog.set_comments(i18n("A Matrix.org client for GNOME").as_str());
dialog.set_copyright(i18n("© 2017–2018 Daniel García Moreno, et al.").as_str());
dialog.set_logo_icon_name(Some(config::APP_ID));
dialog.set_comments(Some(i18n("A Matrix.org client for GNOME").as_str()));
dialog.set_copyright(Some(
i18n("© 2017–2018 Daniel García Moreno, et al.").as_str(),
));
dialog.set_license_type(gtk::License::Gpl30);
dialog.set_modal(true);
dialog.set_version(config::VERSION);
dialog.set_version(Some(config::VERSION));
dialog.set_program_name(&program_name);
dialog.set_website("https://wiki.gnome.org/Fractal");
dialog.set_website_label(i18n("Learn more about Fractal").as_str());
dialog.set_translator_credits(i18n("translator-credits").as_str());
dialog.set_transient_for(&window);
dialog.set_website(Some("https://wiki.gnome.org/Fractal"));
dialog.set_website_label(Some(i18n("Learn more about Fractal").as_str()));
dialog.set_translator_credits(Some(i18n("translator-credits").as_str()));
dialog.set_transient_for(Some(&window));
dialog.set_artists(&["Tobias Bernard"]);
......
......@@ -284,8 +284,8 @@ impl AppOp {
name_btn.hide();
name.set_editable(true);
let image = gtk::Image::new_from_icon_name("emblem-ok-symbolic", gtk::IconSize::Menu);
name_btn.set_image(&image);
let image = gtk::Image::new_from_icon_name(Some("emblem-ok-symbolic"), gtk::IconSize::Menu);
name_btn.set_image(Some(&image));
name_btn.set_sensitive(true);
/* reset the password button */
......@@ -364,13 +364,25 @@ impl AppOp {
let entry = widgets::Address::new(widgets::AddressType::Email, &self)
.create(None);
grid.insert_next_to(&email, gtk::PositionType::Bottom);
grid.attach_next_to(&entry, &email, gtk::PositionType::Bottom, 1, 1);
grid.attach_next_to(
&entry,
Some(&email),
gtk::PositionType::Bottom,
1,
1,
);
first_email = false;
} else {
let entry = widgets::Address::new(widgets::AddressType::Email, &self)
.create(Some(item.address));
grid.insert_next_to(&email, gtk::PositionType::Bottom);
grid.attach_next_to(&entry, &email, gtk::PositionType::Bottom, 1, 1);
grid.attach_next_to(
&entry,
Some(&email),
gtk::PositionType::Bottom,
1,
1,
);
}
}
Medium::MsIsdn => {
......@@ -379,14 +391,26 @@ impl AppOp {
let entry = widgets::Address::new(widgets::AddressType::Phone, &self)
.create(None);
grid.insert_next_to(&phone, gtk::PositionType::Bottom);
grid.attach_next_to(&entry, &phone, gtk::PositionType::Bottom, 1, 1);
grid.attach_next_to(
&entry,
Some(&phone),
gtk::PositionType::Bottom,
1,
1,
);
first_phone = false;
} else {
let s = String::from("+") + &item.address;
let entry = widgets::Address::new(widgets::AddressType::Phone, &self)
.create(Some(s));
grid.insert_next_to(&phone, gtk::PositionType::Bottom);
grid.attach_next_to(&entry, &phone, gtk::PositionType::Bottom, 1, 1);
grid.attach_next_to(
&entry,
Some(&phone),
gtk::PositionType::Bottom,
1,
1,
);
}
}
}
......@@ -480,8 +504,9 @@ impl AppOp {
.expect("Can't find account_settings_name_button in ui file.");
if let Some(name) = name.clone() {
button.hide();
let image = gtk::Image::new_from_icon_name("emblem-ok-symbolic", gtk::IconSize::Menu);
button.set_image(&image);
let image =
gtk::Image::new_from_icon_name(Some("emblem-ok-symbolic"), gtk::IconSize::Menu);
button.set_image(Some(&image));
button.set_sensitive(true);
entry.set_editable(true);
entry.set_text(&name);
......@@ -509,7 +534,7 @@ impl AppOp {
if old_username != username {
let spinner = gtk::Spinner::new();
spinner.start();
button.set_image(&spinner);
button.set_image(Some(&spinner));
button.set_sensitive(false);
name.set_editable(false);
self.backend.send(BKCommand::SetUserName(username)).unwrap();
......
......@@ -47,7 +47,7 @@ impl AppOp {
&[],
);
img.set_from_pixbuf(&pb);
img.set_from_pixbuf(Some(&pb));
img.show();
dialog.get_content_area().add(&img);
dialog.present();
......
......@@ -141,9 +141,10 @@ impl AppOp {
if let Some(aroom) = self.active_room.clone() {
if let Some(r) = self.rooms.get(&aroom) {
if let &Some(ref name) = &r.name {
headerbar.set_title(i18n_k("Invite to {name}", &[("name", name)]).as_str());
headerbar
.set_title(Some(i18n_k("Invite to {name}", &[("name", name)]).as_str()));
} else {
headerbar.set_title(i18n("Invite").as_str());
headerbar.set_title(Some(i18n("Invite").as_str()));
}
}
}
......
use comrak::{markdown_to_html, ComrakOptions};
use gdk_pixbuf::Pixbuf;
use gio::prelude::{FileExt, FileInfoExt};
use gio::prelude::FileExt;
use gstreamer_editing_services::prelude::*;
use gstreamer_editing_services::UriClipAsset;
use gtk;
......@@ -527,7 +527,7 @@ fn get_image_media_info(file: &str, mimetype: &str) -> Option<JsonValue> {
fn get_audio_media_info(file: &str, mimetype: &str) -> Option<JsonValue> {
let nfile = format!("file://{}", file);
let uri = UriClipAsset::request_sync(&nfile).ok()?;
let duration = uri?.get_duration().mseconds()?;
let duration = uri.get_duration().mseconds()?;
let size = fs::metadata(file).ok()?.len();
let info = json!({
......
......@@ -86,7 +86,7 @@ impl AppOp {
fn create_notification(room_id: &str, title: &str, body: &str, avatar: &str) -> Notification {
let notification = Notification::new(title);
notification.set_body(body);
notification.set_body(Some(body));
notification.set_priority(gio::NotificationPriority::High);
info!("Creating notification with avatar: {}", avatar);
let file = gio::File::new_for_path(avatar);
......
......@@ -538,19 +538,19 @@ impl AppOp {
match topic {
None => {
t.set_tooltip_text("");
n.set_tooltip_text("");
t.set_tooltip_text(None);
n.set_tooltip_text(None);
t.hide();
}
Some(ref topic) if topic.is_empty() => {
t.set_tooltip_text("");
n.set_tooltip_text("");
t.set_tooltip_text(None);
n.set_tooltip_text(None);
t.hide();
}
Some(ref topic) => {
n.set_tooltip_text(&topic[..]);
n.set_tooltip_text(Some(&topic[..]));
t.set_markup(&markup_text(&topic.split('\n').next().unwrap_or_default()));
t.set_tooltip_text(&topic[..]);
t.set_tooltip_text(Some(&topic[..]));
t.show();
}
};
......
......@@ -56,7 +56,7 @@ fn main() -> Result<(), Box<dyn Error>> {
gst::init()?;
// Create a Application with default flags
let application = gtk::Application::new(config::APP_ID, gio::ApplicationFlags::empty())?;
let application = gtk::Application::new(Some(config::APP_ID), gio::ApplicationFlags::empty())?;
application.set_resource_base_path(Some("/org/gnome/Fractal"));
......
......@@ -57,8 +57,9 @@ impl<'a> Address<'a> {
self.entry.set_editable(false);
self.action = Some(AddressAction::Delete);
let label = gtk::Image::new_from_icon_name("user-trash-symbolic", gtk::IconSize::Menu);
self.button.set_image(&label);
let label =
gtk::Image::new_from_icon_name(Some("user-trash-symbolic"), gtk::IconSize::Menu);
self.button.set_image(Some(&label));
self.button.show();
} else {
let text = match self.medium {
......@@ -66,10 +67,11 @@ impl<'a> Address<'a> {
AddressType::Phone => "Add Phone",
};
self.entry.set_placeholder_text(text);
self.entry.set_placeholder_text(Some(text));
self.action = Some(AddressAction::Add);
let label = gtk::Image::new_from_icon_name("list-add-symbolic", gtk::IconSize::Menu);
self.button.set_image(&label);
let label =
gtk::Image::new_from_icon_name(Some("list-add-symbolic"), gtk::IconSize::Menu);
self.button.set_image(Some(&label));
self.button
.get_style_context()
.add_class("suggested-action");
......@@ -96,16 +98,18 @@ impl<'a> Address<'a> {
self.entry.set_editable(false);
self.action = Some(AddressAction::Delete);
let label = gtk::Image::new_from_icon_name("user-trash-symbolic", gtk::IconSize::Menu);
self.button.set_image(&label);
let label =
gtk::Image::new_from_icon_name(Some("user-trash-symbolic"), gtk::IconSize::Menu);
self.button.set_image(Some(&label));
self.button
.get_style_context()
.remove_class("suggested-action");
self.button.show();
} else {
self.action = Some(AddressAction::Add);
let label = gtk::Image::new_from_icon_name("list-add-symbolic", gtk::IconSize::Menu);
self.button.set_image(&label);
let label =
gtk::Image::new_from_icon_name(Some("list-add-symbolic"), gtk::IconSize::Menu);
self.button.set_image(Some(&label));
self.button
.get_style_context()
.add_class("suggested-action");
......@@ -164,7 +168,7 @@ impl<'a> Address<'a> {
let spinner = gtk::Spinner::new();
spinner.start();
w.set_image(&spinner);
w.set_image(Some(&spinner));
w.set_sensitive(false);
entry.set_editable(false);
......
......@@ -62,7 +62,7 @@ impl Autocomplete {
alpha: 1.0,
};
let tag = TextTag::new("alias-highlight");
let tag = TextTag::new(Some("alias-highlight"));
tag.set_property_foreground_rgba(Some(&color));
if let Some(buffer) = this.borrow().entry.get_buffer() {
......@@ -394,26 +394,26 @@ impl Autocomplete {
match row {
None => {
if let Some(row) = self.listbox.get_row_at_index(0) {
self.listbox.select_row(&row);
self.listbox.select_row(Some(&row));
result = Some(row.get_children().first()?.clone());
}
}
Some(row) => {
self.listbox.select_row(&row);
self.listbox.select_row(Some(&row));
result = Some(row.get_children().first()?.clone());
}
};
} else {
if let Some(row) = self.listbox.get_children().last() {
if let Ok(row) = row.clone().downcast::<gtk::ListBoxRow>() {
self.listbox.select_row(&row);
self.listbox.select_row(Some(&row));
result = Some(row.get_children().first()?.clone());
}
}
}
} else {
if let Some(row) = self.listbox.get_row_at_index(0) {
self.listbox.select_row(&row);
self.listbox.select_row(Some(&row));
result = Some(row.get_children().first()?.clone());
}
}
......@@ -457,7 +457,7 @@ impl Autocomplete {
self.popover.set_modal(false);
if let Some(row) = self.listbox.get_row_at_index(0) {
self.listbox.select_row(&row);
self.listbox.select_row(Some(&row));
}
self.popover.popup();
......
......@@ -20,7 +20,7 @@ impl NewMessageDivider {
let left_separator = gtk::Separator::new(gtk::Orientation::Horizontal);
left_separator.set_valign(gtk::Align::Center);
let label = gtk::Label::new(text);
let label = gtk::Label::new(Some(text));
label.set_selectable(false);
let right_separator = gtk::Separator::new(gtk::Orientation::Horizontal);
right_separator.set_valign(gtk::Align::Center);
......
......@@ -3,7 +3,7 @@ use gdk_pixbuf;
use gdk_pixbuf::Pixbuf;
use gdk_pixbuf::PixbufAnimation;
use gdk_pixbuf::PixbufAnimationExt;
use gio::prelude::{FileExt, FileInfoExt};
use gio::prelude::FileExt;
use glib;
use gtk;
use gtk::prelude::*;
......
......@@ -57,7 +57,9 @@ impl KickedDialog {
/* This sets the transient_for parent */
pub fn set_parent_window(&self, parent: &gtk::Window) {
self.widgets.msg_kicked_window.set_transient_for(parent);
self.widgets
.msg_kicked_window
.set_transient_for(Some(parent));
}
fn connect(&self) {
......
......@@ -554,7 +554,7 @@ fn set_header_title(ui: &gtk::Builder, title: &str) {
let media_viewer_headerbar = ui
.get_object::<gtk::HeaderBar>("media_viewer_headerbar")
.expect("Cant find media_viewer_headerbar in ui file.");
media_viewer_headerbar.set_title(title);
media_viewer_headerbar.set_title(Some(title));
}
fn loading_state(ui: &gtk::Builder, val: bool) -> bool {
......
......@@ -27,8 +27,8 @@ impl<'a> MemberBox<'a> {
pub fn widget(&self, show_uid: bool) -> gtk::EventBox {
let backend = self.op.backend.clone();
let username = gtk::Label::new("");
let uid = gtk::Label::new("");
let username = gtk::Label::new(None);
let uid = gtk::Label::new(None);
let event_box = gtk::EventBox::new();
let w = gtk::Box::new(gtk::Orientation::Horizontal, 5);
let v = gtk::Box::new(gtk::Orientation::Vertical, 0);
......@@ -42,7 +42,7 @@ impl<'a> MemberBox<'a> {
let mut alias = self.member.get_alias();
alias.push_str("\n");
alias.push_str(&self.member.uid);
username.set_tooltip_text(&alias[..]);
username.set_tooltip_text(Some(&alias[..]));
username.set_margin_end(5);
username.set_ellipsize(pango::EllipsizeMode::End);
username.set_valign(gtk::Align::Center);
......@@ -86,7 +86,7 @@ impl<'a> MemberBox<'a> {
let backend = self.op.backend.clone();
let pill = gtk::Box::new(gtk::Orientation::Horizontal, 3);
let username = gtk::Label::new("");
let username = gtk::Label::new(None);
username.set_text(&self.member.get_alias());
username.set_margin_end(3);
......
......@@ -44,7 +44,7 @@ pub struct MessageBox {
impl MessageBox {
pub fn new(backend: Sender<BKCommand>) -> MessageBox {
let username = gtk::Label::new("");
let username = gtk::Label::new(None);
let eb = gtk::EventBox::new();
let eventbox = gtk::EventBox::new();
let row = gtk::ListBoxRow::new();
......@@ -237,7 +237,7 @@ impl MessageBox {
for light in highlights.clone() {
highlight_username(w.clone(), &attr, &light, text.to_string());
}
w.set_attributes(&attr);
w.set_attributes(Some(&attr));
}
});
......@@ -248,7 +248,7 @@ impl MessageBox {
for light in highlights.clone() {
highlight_username(w.clone(), &attr, &light, text.to_string());
}
w.set_attributes(&attr);
w.set_attributes(Some(&attr));
}
});
......@@ -257,7 +257,7 @@ impl MessageBox {
for light in msg.highlights.clone() {
highlight_username(part.clone(), &attr, &light, text.to_string());
}
part.set_attributes(&attr);
part.set_attributes(Some(&attr));
}
}
}
......@@ -294,7 +294,7 @@ impl MessageBox {
}
fn create_msg(&self, body: &str, k: MsgPartType) -> gtk::Label {
let msg_part = gtk::Label::new("");
let msg_part = gtk::Label::new(None);
msg_part.set_markup(&markup_text(body));
self.set_label_styles(&msg_part);
......@@ -332,7 +332,7 @@ impl MessageBox {
let image = widgets::image::Image::new(&backend, url)
.size(Some(globals::MAX_STICKER_SIZE))
.build();
image.widget.set_tooltip_text(&msg.body[..]);
image.widget.set_tooltip_text(Some(&msg.body[..]));
bx.add(&image.widget);
}
......@@ -372,13 +372,15 @@ impl MessageBox {
}),
);
let download_btn =
gtk::Button::new_from_icon_name("document-save-symbolic", gtk::IconSize::Button.into());
download_btn.set_tooltip_text(i18n("Save").as_str());
let download_btn = gtk::Button::new_from_icon_name(
Some("document-save-symbolic"),
gtk::IconSize::Button.into(),
);
download_btn.set_tooltip_text(Some(i18n("Save").as_str()));
let data = glib::Variant::from(msg.id.as_str());
download_btn.set_action_target_value(&data);
download_btn.set_action_name("room_history.save_as");
download_btn.set_action_target_value(Some(&data));
download_btn.set_action_name(Some("room_history.save_as"));
bx.pack_start(&player.container, false, true, 0);
bx.pack_start(&download_btn, false, false, 3);
......@@ -390,27 +392,31 @@ impl MessageBox {
let btn_bx = gtk::Box::new(gtk::Orientation::Horizontal, 0);
let name = msg.body.as_str();
let name_lbl = gtk::Label::new(name);
name_lbl.set_tooltip_text(name);
let name_lbl = gtk::Label::new(Some(name));
name_lbl.set_tooltip_text(Some(name));
name_lbl.set_ellipsize(pango::EllipsizeMode::End);
name_lbl.get_style_context().add_class("msg-highlighted");
let download_btn =
gtk::Button::new_from_icon_name("document-save-symbolic", gtk::IconSize::Button.into());
download_btn.set_tooltip_text(i18n("Save").as_str());
let download_btn = gtk::Button::new_from_icon_name(
Some("document-save-symbolic"),
gtk::IconSize::Button.into(),
);
download_btn.set_tooltip_text(Some(i18n("Save").as_str()));
let data = glib::Variant::from(msg.id.as_str());
download_btn.set_action_target_value(&data);
download_btn.set_action_name("room_history.save_as");
download_btn.set_action_target_value(Some(&data));