From b4819076814b5294e4b52f5695d92ae2d79df0d6 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sat, 16 Apr 2005 11:33:46 +0000 Subject: Allow setting view spacing, default to 0 2005-04-16 Marco Pesenti Gritti * shell/ev-view.c: (ev_view_set_spacing), (ev_view_init): * shell/ev-view.h: Allow setting view spacing, default to 0 * shell/ev-window.c: (ev_window_unfullscreen), (ev_window_cmd_view_fullscreen), (ev_window_init): Remove spacing in fullscreen mode --- diff --git a/ChangeLog b/ChangeLog index f122748..b700016 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2005-04-16 Marco Pesenti Gritti + * shell/ev-view.c: (ev_view_set_spacing), (ev_view_init): + * shell/ev-view.h: + + Allow setting view spacing, default to 0 + + * shell/ev-window.c: (ev_window_unfullscreen), + (ev_window_cmd_view_fullscreen), (ev_window_init): + + Remove spacing in fullscreen mode + +2005-04-16 Marco Pesenti Gritti + * shell/ev-view.c: (compute_border), (compute_zoom_factor), (ev_view_size_request), (expose_bin_window), (ev_view_set_show_border), (ev_view_init), (page_changed_cb): diff --git a/shell/ev-view.c b/shell/ev-view.c index 95352c1..a052582 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -1285,12 +1285,25 @@ ev_view_class_init (EvViewClass *class) add_scroll_binding_shifted (binding_set, GDK_BackSpace, EV_SCROLL_PAGE_BACKWARD, EV_SCROLL_PAGE_FORWARD, FALSE); } +void +ev_view_set_spacing (EvView *view, + int spacing) +{ + g_return_if_fail (EV_IS_VIEW (view)); + + view->spacing = spacing; + + if (view->document) { + gtk_widget_queue_resize (GTK_WIDGET (view)); + } +} + static void ev_view_init (EvView *view) { GTK_WIDGET_SET_FLAGS (view, GTK_CAN_FOCUS); - view->spacing = 10; + view->spacing = 0; view->scale = 1.0; view->current_page = 0; view->pressed_button = -1; diff --git a/shell/ev-view.h b/shell/ev-view.h index 09c1600..a0b5806 100644 --- a/shell/ev-view.h +++ b/shell/ev-view.h @@ -54,6 +54,8 @@ void ev_view_zoom_out (EvView *view); void ev_view_set_size (EvView *view, int width, int height); +void ev_view_set_spacing (EvView *view, + int spacing); void ev_view_set_show_border (EvView *view, gboolean show_border); diff --git a/shell/ev-window.c b/shell/ev-window.c index 182261c..372520c 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -150,7 +150,9 @@ static GtkTargetEntry ev_drop_types[] = { #define GCONF_CHROME_STATUSBAR "/apps/evince/show_statusbar" #define GCONF_SIDEBAR_SIZE "/apps/evince/sidebar_size" + #define SIDEBAR_DEFAULT_SIZE 132 +#define VIEW_SPACING 10 static void ev_window_update_fullscreen_popup (EvWindow *window); static void ev_window_sidebar_visibility_changed_cb (EvSidebar *ev_sidebar, GParamSpec *pspec, @@ -1419,6 +1421,8 @@ ev_window_fullscreen (EvWindow *window) static void ev_window_unfullscreen (EvWindow *window) { + EvView *view = EV_VIEW (window->priv->view); + window->priv->fullscreen_mode = FALSE; g_object_set (G_OBJECT (window->priv->scrolled_window), @@ -1427,32 +1431,34 @@ ev_window_unfullscreen (EvWindow *window) fullscreen_clear_timeout (window); - g_signal_handlers_disconnect_by_func (window->priv->view, + g_signal_handlers_disconnect_by_func (view, (gpointer) fullscreen_motion_notify_cb, window); -// destroy_fullscreen_popup (window); - - ev_view_set_show_border (EV_VIEW (window->priv->view), TRUE); + ev_view_set_show_border (view, TRUE); + ev_view_set_spacing (view, VIEW_SPACING); update_chrome_visibility (window); } static void -ev_window_cmd_view_fullscreen (GtkAction *action, EvWindow *ev_window) +ev_window_cmd_view_fullscreen (GtkAction *action, EvWindow *window) { + EvView *view; gboolean fullscreen; - g_return_if_fail (EV_IS_WINDOW (ev_window)); + g_return_if_fail (EV_IS_WINDOW (window)); + view = EV_VIEW (window->priv->view); fullscreen = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); if (fullscreen) { - gtk_window_fullscreen (GTK_WINDOW (ev_window)); + gtk_window_fullscreen (GTK_WINDOW (window)); } else { - gtk_window_unfullscreen (GTK_WINDOW (ev_window)); + gtk_window_unfullscreen (GTK_WINDOW (window)); } - ev_view_set_show_border (EV_VIEW (ev_window->priv->view), FALSE); + ev_view_set_show_border (view, FALSE); + ev_view_set_spacing (view, 0); } static gboolean @@ -2498,7 +2504,7 @@ ev_window_init (EvWindow *ev_window) ev_window->priv->scrolled_window); ev_window->priv->view = ev_view_new (); - //ev_window->priv->page_view = ev_page_view_new (); + ev_view_set_spacing (EV_VIEW (ev_window->priv->view), VIEW_SPACING); ev_window->priv->password_view = ev_password_view_new (); g_signal_connect_swapped (ev_window->priv->password_view, "unlock", -- cgit v0.9.1