]> www.fi.muni.cz Git - evince.git/commitdiff
Allow setting view spacing, default to 0
authorMarco Pesenti Gritti <mpg@redhat.com>
Sat, 16 Apr 2005 11:33:46 +0000 (11:33 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Sat, 16 Apr 2005 11:33:46 +0000 (11:33 +0000)
2005-04-16  Marco Pesenti Gritti <mpg@redhat.com>

        * 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

ChangeLog
shell/ev-view.c
shell/ev-view.h
shell/ev-window.c

index f122748834d7d1863a8c3cea55b4db7667e2ae24..b7000165c6a7dfa95ac25e767c31457996caaac4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2005-04-16  Marco Pesenti Gritti <mpg@redhat.com>
+
+       * 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 <mpg@redhat.com>
 
        * shell/ev-view.c: (compute_border), (compute_zoom_factor),
index 95352c1d2abbeb0fdcd1a61d4e84ed58849c4851..a052582884482c800bf30706bc9ae7bb7859196a 100644 (file)
@@ -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;
index 09c160058232f5fc2e51f65ec927ed26261a9ee4..a0b58063b3e5ec73599728b509afea28c6678696 100644 (file)
@@ -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);
 
index 182261ca4ade10305096a34b25f5841818fbed28..372520c1151cdcf4b12bc867754c300ac23fbe10 100644 (file)
@@ -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",