diff --git a/fractal-gtk/src/widgets/avatar.rs b/fractal-gtk/src/widgets/avatar.rs index 4ff0751a..fbe9b4ec 100644 --- a/fractal-gtk/src/widgets/avatar.rs +++ b/fractal-gtk/src/widgets/avatar.rs @@ -77,7 +77,6 @@ impl AvatarExt for gtk::Box { gtk::render_background(&context, g, 0.0, 0.0, width, height); g.set_antialias(cairo::Antialias::Best); - let img = gtk::Image::new_from_icon_name(&icon[..], 5); let icon = gtk::IconTheme::get_default().unwrap() .load_icon(&icon[..], s, gtk::IconLookupFlags::empty()) .unwrap(); @@ -101,6 +100,11 @@ impl AvatarExt for gtk::Box { } fn circle(&self, path: String, size: Option) { + if path.starts_with("mxc:") { + self.default(String::from("image-loading-symbolic"), size); + return; + } + self.clean(); let da = self.create_da(size); let s = size.unwrap_or(40); @@ -115,7 +119,6 @@ impl AvatarExt for gtk::Box { let context = da.get_style_context().unwrap(); gtk::render_background(&context, g, 0.0, 0.0, width, height); - g.set_antialias(cairo::Antialias::Best); if let Ok(pb) = Pixbuf::new_from_file_at_scale(&p, width as i32, -1, true) { let hpos: f64 = (width - (pb.get_height()) as f64) / 2.0; diff --git a/fractal-gtk/src/widgets/member.rs b/fractal-gtk/src/widgets/member.rs index c7526a4a..5563c24d 100644 --- a/fractal-gtk/src/widgets/member.rs +++ b/fractal-gtk/src/widgets/member.rs @@ -86,7 +86,7 @@ pub fn get_member_avatar(backend: Sender, img: widgets::Avatar, m: Op pub fn get_member_info(backend: Sender, img: widgets::Avatar, username: gtk::Label, sender: String, size: i32, tries: i32) { let (tx, rx): (Sender<(String, String)>, Receiver<(String, String)>) = channel(); backend.send(BKCommand::GetUserInfoAsync(sender.clone(), tx)).unwrap(); - gtk::timeout_add(50, move || match rx.try_recv() { + gtk::timeout_add(100, move || match rx.try_recv() { Err(_) => gtk::Continue(true), Ok((name, avatar)) => { if let Ok(_) = Pixbuf::new_from_file_at_scale(&avatar, size, size, false) {