diff options
Diffstat (limited to 'libview')
-rw-r--r-- | libview/ev-loading-window.c | 22 |
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, |