summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-12-09 23:17:21 +0100
committerinfirit <[email protected]>2014-12-09 23:17:21 +0100
commitb9389aada734dfc328c6db2a7bfd4f7e2c0c90a5 (patch)
tree4c07b9be5fab94f370828e4a0e0cfe38528fb516
parent1bd8321a918cc416e6b8c81b7b72fb729e1b5369 (diff)
downloadatril-b9389aada734dfc328c6db2a7bfd4f7e2c0c90a5.tar.bz2
atril-b9389aada734dfc328c6db2a7bfd4f7e2c0c90a5.tar.xz
libview: Stop the GtkSpinner when the loading window is hidden
Taken from evince commit: 220956ee03fa37fb55079aff63675db26cd908f9 From: Cristian KLEIN <[email protected]> Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=637390
-rw-r--r--libview/ev-loading-window.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/libview/ev-loading-window.c b/libview/ev-loading-window.c
index 973cfa45..2b79d4ed 100644
--- a/libview/ev-loading-window.c
+++ b/libview/ev-loading-window.c
@@ -33,6 +33,7 @@ struct _EvLoadingWindow {
GtkWindow base_instance;
GtkWindow *parent;
+ GtkWidget *spinner;
gint x;
gint y;
@@ -69,7 +70,6 @@ ev_loading_window_init (EvLoadingWindow *window)
GtkWindow *gtk_window = GTK_WINDOW (window);
GtkWidget *widget = GTK_WIDGET (window);
GtkWidget *hbox;
- GtkWidget *spinner;
GtkWidget *label;
GtkStyle *style;
GdkColor fg, bg;
@@ -79,10 +79,9 @@ ev_loading_window_init (EvLoadingWindow *window)
hbox = gtk_hbox_new (FALSE, 12);
- spinner = gtk_spinner_new ();
- gtk_spinner_start (GTK_SPINNER (spinner));
- gtk_box_pack_start (GTK_BOX (hbox), spinner, FALSE, FALSE, 0);
- gtk_widget_show (spinner);
+ window->spinner = gtk_spinner_new ();
+ gtk_box_pack_start (GTK_BOX (hbox), window->spinner, FALSE, FALSE, 0);
+ gtk_widget_show (window->spinner);
label = gtk_label_new (loading_text);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
@@ -234,10 +233,22 @@ ev_loading_window_hide (GtkWidget *widget)
window->x = window->y = 0;
+ gtk_spinner_stop (GTK_SPINNER (window->spinner));
+
GTK_WIDGET_CLASS (ev_loading_window_parent_class)->hide (widget);
}
static void
+ev_loading_window_show (GtkWidget *widget)
+{
+ EvLoadingWindow *window = EV_LOADING_WINDOW (widget);
+
+ gtk_spinner_start (GTK_SPINNER (window->spinner));
+
+ GTK_WIDGET_CLASS (ev_loading_window_parent_class)->show (widget);
+}
+
+static void
ev_loading_window_class_init (EvLoadingWindowClass *klass)
{
GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
@@ -247,6 +258,7 @@ ev_loading_window_class_init (EvLoadingWindowClass *klass)
g_object_class->set_property = ev_loading_window_set_property;
gtk_widget_class->size_allocate = ev_loading_window_size_allocate;
+ gtk_widget_class->show = ev_loading_window_show;
gtk_widget_class->hide = ev_loading_window_hide;
g_object_class_install_property (g_object_class,