Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/ev-view.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2005-01-04 11:39:08 (GMT)
committer Marco Pesenti Gritti <marco@src.gnome.org>2005-01-04 11:39:08 (GMT)
commitd1e23d13d52f06f2aba2ece7ff17091110d8a3bb (patch)
tree41c445f49721f45efb7b2fa0897830031174ae4a /shell/ev-view.c
parent44a5ea12157e001973538d01e4620b4be80c82c9 (diff)
Change the layout to match clarkbw design.
2005-01-04 Marco Pesenti Gritti <marco@gnome.org> * data/evince-ui.xml: Change the layout to match clarkbw design. * shell/Makefile.am: * shell/ev-navigation-action.c: (build_menu), (menu_activated_cb), (set_tooltip_cb), (connect_proxy), (ev_navigation_action_init), (ev_navigation_action_finalize), (ev_navigation_action_set_property), (ev_navigation_action_get_property), (ev_navigation_action_class_init): * shell/ev-navigation-action.h: Implement clarkbw toolbar navigation controls (incomplete) * shell/ev-page-action.c: (update_label), (update_spin), (value_changed_cb), (create_tool_item), (connect_proxy), (ev_page_action_init), (ev_page_action_finalize), (ev_page_action_set_property), (ev_page_action_get_property), (ev_page_action_set_current_page), (ev_page_action_set_total_pages), (ev_page_action_class_init): * shell/ev-page-action.h: Implement a page switcher in the toolbar * shell/ev-view.c: (ev_view_scroll_view): * shell/ev-window.c: (update_total_pages), (ev_window_open), (update_current_page), (view_page_changed_cb), (goto_page_cb), (register_custom_actions), (ev_window_init): Change page on PageUp/Down.
Diffstat (limited to 'shell/ev-view.c')
-rw-r--r--shell/ev-view.c59
1 files changed, 30 insertions, 29 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c
index b9dda6a..1fdf5d5 100644
--- a/shell/ev-view.c
+++ b/shell/ev-view.c
@@ -455,40 +455,41 @@ add_scroll_binding (GtkBindingSet *binding_set,
static void
ev_view_scroll_view (EvView *view,
- GtkScrollType scroll,
- gboolean horizontal)
+ GtkScrollType scroll,
+ gboolean horizontal)
{
- GtkAdjustment *adjustment;
- double value;
-
- if (horizontal) {
- adjustment = view->hadjustment;
+ if (scroll == GTK_SCROLL_PAGE_BACKWARD) {
+ ev_view_set_page (view, ev_view_get_page (view) - 1);
+ } else if (scroll == GTK_SCROLL_PAGE_FORWARD) {
+ ev_view_set_page (view, ev_view_get_page (view) + 1);
} else {
- adjustment = view->vadjustment;
- }
+ GtkAdjustment *adjustment;
+ double value;
- value = adjustment->value;
-
- switch (scroll) {
- case GTK_SCROLL_STEP_BACKWARD:
- value -= adjustment->step_increment;
- break;
- case GTK_SCROLL_STEP_FORWARD:
- value += adjustment->step_increment;
- break;
- case GTK_SCROLL_PAGE_BACKWARD:
- value -= adjustment->page_increment;
- break;
- case GTK_SCROLL_PAGE_FORWARD:
- value += adjustment->page_increment;
- break;
- default:
- break;
- }
+ if (horizontal) {
+ adjustment = view->hadjustment;
+ } else {
+ adjustment = view->vadjustment;
+ }
- value = CLAMP (value, adjustment->lower, adjustment->upper - adjustment->page_size);
+ value = adjustment->value;
+
+ switch (scroll) {
+ case GTK_SCROLL_STEP_BACKWARD:
+ value -= adjustment->step_increment;
+ break;
+ case GTK_SCROLL_STEP_FORWARD:
+ value += adjustment->step_increment;
+ break;
+ default:
+ break;
+ }
- gtk_adjustment_set_value (adjustment, value);
+ value = CLAMP (value, adjustment->lower,
+ adjustment->upper - adjustment->page_size);
+
+ gtk_adjustment_set_value (adjustment, value);
+ }
}
static void