Commit d2a8df12 authored by Sophie Herold's avatar Sophie Herold

Stop GtkSpinner's while invisible

Issue #45
parent 0c2e1c9f
Pipeline #221042 passed with stage
in 15 minutes and 16 seconds
......@@ -676,10 +676,9 @@ This might take a while.</property>
<property name="no-show-all">True</property>
<property name="popover">pending_popover</property>
<child>
<object class="GtkSpinner">
<object class="GtkSpinner" id="pending_menu_spinner">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="active">True</property>
</object>
</child>
<style>
......@@ -850,10 +849,9 @@ This might take a while.</property>
</packing>
</child>
<child>
<object class="GtkSpinner">
<object class="GtkSpinner" id="status_icon_spinner">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="active">True</property>
</object>
<packing>
<property name="name">running</property>
......@@ -1554,12 +1552,11 @@ This might take a while.</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkSpinner">
<object class="GtkSpinner" id="page_pending_spinner">
<property name="width-request">64</property>
<property name="height-request">64</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="active">True</property>
</object>
<packing>
<property name="expand">False</property>
......
......@@ -125,6 +125,7 @@ fn init(_app: &gtk::Application) {
ui::detail::init();
ui::headerbar::init();
ui::config_list::init();
ui::main_pending::init();
gtk_app().set_accels_for_action("app.quit", &["<Ctrl>Q"]);
......
......@@ -299,6 +299,10 @@ impl Main {
self.get("page_pending")
}
pub fn page_pending_spinner(&self) -> gtk::Spinner {
self.get("page_pending_spinner")
}
pub fn page_start(&self) -> gtk::Box {
self.get("page_start")
}
......@@ -307,6 +311,10 @@ impl Main {
self.get("pending_menu")
}
pub fn pending_menu_spinner(&self) -> gtk::Spinner {
self.get("pending_menu_spinner")
}
pub fn pending_popover(&self) -> gtk::Popover {
self.get("pending_popover")
}
......@@ -355,6 +363,10 @@ impl Main {
self.get("status_icon")
}
pub fn status_icon_spinner(&self) -> gtk::Spinner {
self.get("status_icon_spinner")
}
pub fn status_subtext(&self) -> gtk::Label {
self.get("status_subtext")
}
......
......@@ -65,6 +65,9 @@ pub fn init() {
.stop_backup_create()
.connect_clicked(|_| stop_backup_create());
main_ui().status_icon_spinner().connect_map(|s| s.start());
main_ui().status_icon_spinner().connect_unmap(|s| s.stop());
glib::timeout_add_local(500, || {
refresh_statusx();
Continue(true)
......
......@@ -14,6 +14,9 @@ pub fn init() {
.connect_property_visible_child_notify(content_stack_changed);
main_ui().show_overview().connect_clicked(show_overview);
main_ui().pending_menu_spinner().connect_map(|s| s.start());
main_ui().pending_menu_spinner().connect_unmap(|s| s.stop());
}
pub fn update() {
......
......@@ -7,6 +7,11 @@ thread_local!(
static LAST_SHOW: Cell<Option<bool>> = Default::default();
);
pub fn init() {
main_ui().page_pending_spinner().connect_map(|s| s.start());
main_ui().page_pending_spinner().connect_unmap(|s| s.stop());
}
pub fn show(msg: &str) {
LAST_PAGE.with(|last_page| last_page.set(main_ui().content_stack().get_visible_child()));
LAST_SHOW.with(|last_show| last_show.set(Some(main_ui().leaflet_left().get_visible())));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment