Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/previewer
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2009-08-21 10:56:35 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2009-09-15 13:56:02 (GMT)
commit8f8663bd6503f53ad78c68aefe44800575959944 (patch)
treed8742a67c47e6cc205f024b20e7c246080499e8c /previewer
parent6965a51a28f76d0a669d0d1c9fdc089e6cf46c7d (diff)
Remove zoom-invalid signal from EvView
It was used by EvView when sizing mode was best-fit or fit-width to request the window for its content size. This is not needed at all, since we already call size_allocate on parent class. GtkScrolledWindow takes into account the shadow type and scrollbars visibility in its size_allocate method, so we can just take the allocation returned to calculate the zoom in case of best-fit or fit-width.
Diffstat (limited to 'previewer')
-rw-r--r--previewer/ev-previewer-window.c43
1 files changed, 1 insertions, 42 deletions
diff --git a/previewer/ev-previewer-window.c b/previewer/ev-previewer-window.c
index 686fb0d..c406a22 100644
--- a/previewer/ev-previewer-window.c
+++ b/previewer/ev-previewer-window.c
@@ -71,42 +71,6 @@ get_screen_dpi (GtkWindow *window)
return (xdpi + ydpi) / 2.0;
}
-static void
-ev_previewer_window_set_view_size (EvPreviewerWindow *window)
-{
- gint width, height;
- GtkRequisition vsb_requisition;
- GtkRequisition hsb_requisition;
- gint scrollbar_spacing;
-
- if (!window->view)
- return;
-
- /* Calculate the width available for the content */
- width = window->swindow->allocation.width;
- height = window->swindow->allocation.height;
-
- if (gtk_scrolled_window_get_shadow_type (GTK_SCROLLED_WINDOW (window->swindow)) == GTK_SHADOW_IN) {
- width -= 2 * GTK_WIDGET (window->view)->style->xthickness;
- height -= 2 * GTK_WIDGET (window->view)->style->ythickness;
- }
-
- gtk_widget_size_request (GTK_SCROLLED_WINDOW (window->swindow)->vscrollbar,
- &vsb_requisition);
- gtk_widget_size_request (GTK_SCROLLED_WINDOW (window->swindow)->hscrollbar,
- &hsb_requisition);
- gtk_widget_style_get (window->swindow,
- "scrollbar_spacing",
- &scrollbar_spacing,
- NULL);
-
- ev_view_set_zoom_for_size (window->view,
- MAX (1, width),
- MAX (1, height),
- vsb_requisition.width + scrollbar_spacing,
- hsb_requisition.height + scrollbar_spacing);
-}
-
#if GTKUNIXPRINT_ENABLED
static void
ev_previewer_window_error_dialog_run (EvPreviewerWindow *window,
@@ -163,7 +127,6 @@ ev_previewer_window_zoom_best_fit (GtkToggleAction *action,
{
if (gtk_toggle_action_get_active (action)) {
ev_view_set_sizing_mode (window->view, EV_SIZING_BEST_FIT);
- ev_previewer_window_set_view_size (window);
} else {
ev_view_set_sizing_mode (window->view, EV_SIZING_FREE);
}
@@ -175,7 +138,6 @@ ev_previewer_window_zoom_page_width (GtkToggleAction *action,
{
if (gtk_toggle_action_get_active (action)) {
ev_view_set_sizing_mode (window->view, EV_SIZING_FIT_WIDTH);
- ev_previewer_window_set_view_size (window);
} else {
ev_view_set_sizing_mode (window->view, EV_SIZING_FREE);
}
@@ -478,10 +440,7 @@ ev_previewer_window_init (EvPreviewerWindow *window)
g_signal_connect (window->view, "notify::sizing-mode",
G_CALLBACK (view_sizing_mode_changed),
window);
- g_signal_connect_swapped (window->view, "zoom_invalid",
- G_CALLBACK (ev_previewer_window_set_view_size),
- window);
-
+
ev_view_set_screen_dpi (window->view, get_screen_dpi (GTK_WINDOW (window)));
ev_view_set_continuous (window->view, FALSE);
ev_view_set_sizing_mode (window->view, EV_SIZING_FIT_WIDTH);