diff options
author | Anders Carlsson <andersca@gnome.org> | 2005-01-13 16:23:29 (GMT) |
---|---|---|
committer | Anders Carlsson <andersca@src.gnome.org> | 2005-01-13 16:23:29 (GMT) |
commit | ddc0ad5b3bd75a640ba362cdccde7449654bae61 (patch) | |
tree | ef105a01f51717108cd6948825834d4e122d75a2 /shell/ev-page-action.c | |
parent | 62af2b5b013e01e3ed188d8bd48dc52f5b25267c (diff) |
Set the spin button limits correctly.
2005-01-13 Anders Carlsson <andersca@gnome.org>
* 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.
Diffstat (limited to 'shell/ev-page-action.c')
-rw-r--r-- | shell/ev-page-action.c | 13 |
1 files changed, 12 insertions, 1 deletions
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); |