item_row: Stop spinners when idle

This commit is contained in:
Maximiliano Sandoval R 2023-04-10 13:49:11 +02:00
parent d3a9732cae
commit d4d9217c4a
No known key found for this signature in database
GPG key ID: D64A8D747F6FE706

View file

@ -4,7 +4,7 @@ use gtk::{gio, glib, glib::clone};
use matrix_sdk::room::timeline::TimelineItemContent;
use crate::{
components::{ContextMenuBin, ContextMenuBinExt, ContextMenuBinImpl, ReactionChooser},
components::{ContextMenuBin, ContextMenuBinExt, ContextMenuBinImpl, ReactionChooser, Spinner},
session::{
content::room_history::{
message_row::MessageRow, DividerRow, RoomHistory, StateRow, TypingRow,
@ -295,18 +295,16 @@ impl ItemRow {
PlaceholderKind::Spinner => {
if self
.child()
.filter(|widget| widget.is::<gtk::Spinner>())
.filter(|widget| widget.is::<Spinner>())
.is_none()
{
self.set_popover(None);
self.set_action_group(None);
self.set_event_actions(None);
let spinner = gtk::Spinner::builder()
.spinning(true)
.margin_top(12)
.margin_bottom(12)
.build();
let spinner = Spinner::default();
spinner.set_margin_top(12);
spinner.set_margin_bottom(12);
self.set_child(Some(&spinner));
}
}