From ddc0ad5b3bd75a640ba362cdccde7449654bae61 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Thu, 13 Jan 2005 16:23:29 +0000 Subject: Set the spin button limits correctly. 2005-01-13 Anders Carlsson * shell/ev-page-action.c: (update_spin), (total_pages_changed_cb), (create_tool_item): Set the spin button limits correctly. * shell/ev-sidebar-thumbnails.c: (ev_sidebar_tree_selection_changed), (ev_sidebar_thumbnails_init): Support changing pages by clicking on the thumbnails. --- (limited to 'shell/ev-page-action.c') diff --git a/shell/ev-page-action.c b/shell/ev-page-action.c index a13d61e..29bae4e 100644 --- a/shell/ev-page-action.c +++ b/shell/ev-page-action.c @@ -84,7 +84,7 @@ update_spin (GtkAction *action, gpointer dummy, GtkWidget *proxy) value = gtk_spin_button_get_value (GTK_SPIN_BUTTON (spin)); - if (value != page->priv->current_page) + if (value != page->priv->current_page ) { gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), page->priv->current_page); @@ -101,6 +101,14 @@ value_changed_cb (GtkWidget *spin, GtkAction *action) g_signal_emit (action, signals[GOTO_PAGE_SIGNAL], 0, value); } +static void +total_pages_changed_cb (EvPageAction *action, GParamSpec *pspec, + GtkSpinButton *spin) +{ + gtk_spin_button_set_range (GTK_SPIN_BUTTON (spin), 1, + action->priv->total_pages); +} + static GtkWidget * create_tool_item (GtkAction *action) { @@ -118,6 +126,9 @@ create_tool_item (GtkAction *action) g_object_set_data (G_OBJECT (item), "spin", spin); gtk_widget_show (spin); + g_signal_connect (action, "notify::total-pages", + G_CALLBACK (total_pages_changed_cb), + spin); g_signal_connect (spin, "value_changed", G_CALLBACK (value_changed_cb), action); -- cgit v0.9.1