From 266cf1e14f400292972534bb92802e5004d653ce Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 25 Aug 2024 15:33:34 +0300 Subject: Don't use an extraneous Box for the spinner --- src/lib.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4cd388b..913a9a4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -169,20 +169,14 @@ impl AsyncComponent for App { window } - fn init_loading_widgets(_root: Self::Root) -> Option { - let root = gtk::Box::default(); - root.set_hexpand(true); - root.set_vexpand(true); - root.set_halign(gtk::Align::Center); - root.set_valign(gtk::Align::Center); + fn init_loading_widgets(root: Self::Root) -> Option { let spinner = gtk::Spinner::builder() .spinning(true) .halign(gtk::Align::Center) .valign(gtk::Align::Center) .build(); - _root.set_content(Some(&root)); - root.append(&spinner); + root.set_content(Some(&spinner)); Some(LoadingWidgets::new(root, spinner)) } -- cgit 1.4.1