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 <mpg@redhat.com>2005-04-22 09:46:25 (GMT)
committer Marco Pesenti Gritti <marco@src.gnome.org>2005-04-22 09:46:25 (GMT)
commita6e6d94bd65dd562a9e802b7a27aa71f8e4ad160 (patch)
tree9894dce257ed1b04134a0dd70cf7fbb6869a67cf /shell/ev-view.c
parenta9a3c41262ca008c326e7a97ab0608608d144caa (diff)
Fix normal size zoom. Make zoom in/zoom out unsensitive when they are
2005-04-22 Marco Pesenti Gritti <mpg@redhat.com> * shell/ev-view.c: (ev_view_can_zoom_in), (ev_view_can_zoom_out), (ev_view_zoom_out), (ev_view_zoom_normal): * shell/ev-view.h: * shell/ev-window.c: (update_action_sensitivity), (ev_window_cmd_view_best_fit), (ev_window_cmd_view_page_width), (ev_window_cmd_view_zoom_in), (ev_window_cmd_view_zoom_out), (ev_window_cmd_view_normal_size): Fix normal size zoom. Make zoom in/zoom out unsensitive when they are behyond the limits. Tweak MAX_ZOOM to 6, sucks but better than oom.
Diffstat (limited to 'shell/ev-view.c')
-rw-r--r--shell/ev-view.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c
index cca3947..796aadd 100644
--- a/shell/ev-view.c
+++ b/shell/ev-view.c
@@ -77,7 +77,7 @@ typedef enum {
#define ZOOM_OUT_FACTOR (1.0/ZOOM_IN_FACTOR)
#define MIN_SCALE 0.05409
-#define MAX_SCALE 18.4884
+#define MAX_SCALE 6.0
struct _EvView {
GtkWidget parent_instance;
@@ -1597,6 +1597,26 @@ ev_view_zoom (EvView *view,
gtk_widget_queue_resize (GTK_WIDGET (view));
}
+gboolean
+ev_view_can_zoom_in (EvView *view)
+{
+ if (view->width != -1 || view->height != -1) {
+ return TRUE;
+ }
+
+ return view->scale * ZOOM_IN_FACTOR <= MAX_SCALE;
+}
+
+gboolean
+ev_view_can_zoom_out (EvView *view)
+{
+ if (view->width != -1 || view->height != -1) {
+ return TRUE;
+ }
+
+ return view->scale * ZOOM_OUT_FACTOR >= MIN_SCALE;
+}
+
void
ev_view_zoom_in (EvView *view)
{
@@ -1610,6 +1630,12 @@ ev_view_zoom_out (EvView *view)
}
void
+ev_view_zoom_normal (EvView *view)
+{
+ ev_view_zoom (view, 1.0, FALSE);
+}
+
+void
ev_view_set_size (EvView *view,
int width,
int height)