]> www.fi.muni.cz Git - evince.git/commitdiff
Do not draw the border in fulscreen
authorMarco Pesenti Gritti <mpg@redhat.com>
Sat, 16 Apr 2005 11:02:13 +0000 (11:02 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Sat, 16 Apr 2005 11:02:13 +0000 (11:02 +0000)
2005-04-16  Marco Pesenti Gritti <mpg@redhat.com>

        * 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):
        * shell/ev-view.h:
        * shell/ev-window.c: (ev_window_unfullscreen),
        (ev_window_cmd_view_fullscreen):

        Do not draw the border in fulscreen

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

index f1a6b2a511f94657829cf2c5e4328720d45666e0..f122748834d7d1863a8c3cea55b4db7667e2ae24 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2005-04-16  Marco Pesenti Gritti <mpg@redhat.com>
+
+       * 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):
+       * shell/ev-view.h:
+       * shell/ev-window.c: (ev_window_unfullscreen),
+       (ev_window_cmd_view_fullscreen):
+
+       Do not draw the border in fulscreen
+
 2005-04-16  Marco Pesenti Gritti <mpg@redhat.com>
 
        * shell/ev-view.c: (ev_view_get_offsets), (compute_zoom_factor),
index b11a4bc2d77c1c0ecf248406a046af4469753afb..95352c1d2abbeb0fdcd1a61d4e84ed58849c4851 100644 (file)
@@ -115,6 +115,7 @@ struct _EvView {
        int width;
        int height;
        GtkBorder border;
+       gboolean show_border;
 };
 
 struct _EvViewClass {
@@ -281,6 +282,19 @@ doc_rect_to_view_rect (EvView *view, EvRectangle *doc_rect, GdkRectangle *view_r
        view_rect->height = ceil (doc_rect->y2 * view->scale) + y_offset - view_rect->y;
 }
 
+static void
+compute_border (EvView *view, int width, int height, GtkBorder *border)
+{
+       if (view->show_border) {
+               ev_document_misc_get_page_border_size (width, height, border);
+       } else {
+               border->left = 0;
+               border->right = 0;
+               border->top = 0;
+               border->bottom = 0;
+       }
+}
+
 static void
 compute_zoom_factor (EvView *view)
 {
@@ -300,7 +314,7 @@ compute_zoom_factor (EvView *view)
                                &doc_width,
                                &doc_height);
 
-       ev_document_misc_get_page_border_size (doc_width, doc_height, &border);
+       compute_border (view, doc_width, doc_height, &border);
 
        if (doc_width == 0 || doc_height == 0) {
                return;
@@ -354,11 +368,12 @@ ev_view_size_request (GtkWidget      *widget,
                                view->scale,
                                &width, &height);
 
+       compute_border (view, width, height, &(view->border));
+
        ev_pixbuf_cache_set_page_range (view->pixbuf_cache,
                                        view->current_page,
                                        view->current_page,
                                        view->scale);
-       ev_document_misc_get_page_border_size (width, height, &(view->border));
 
        if (view->width >= 0) {
                requisition->width = 0;
@@ -569,8 +584,11 @@ expose_bin_window (GtkWidget      *widget,
        area.y = y_offset;
        area.width = width + view->border.left + view->border.right;
        area.height = height + view->border.top + view->border.bottom;
-       ev_document_misc_paint_one_page (view->bin_window, widget, &area,
-                                        &(view->border));
+
+       if (view->show_border) {
+               ev_document_misc_paint_one_page (view->bin_window, widget, &area,
+                                                &(view->border));
+       }
 
        /* Render the document itself */
        LOG ("Render area %d %d %d %d - Offset %d %d",
@@ -680,6 +698,16 @@ ev_view_copy (EvView *ev_view)
        g_free (text);
 }
 
+void
+ev_view_set_show_border (EvView *view, gboolean show_border)
+{
+       g_return_if_fail (EV_IS_VIEW (view));
+
+       view->show_border = show_border;
+
+       gtk_widget_queue_resize (GTK_WIDGET (view));
+}
+
 static void
 ev_view_primary_get_cb (GtkClipboard     *clipboard,
                        GtkSelectionData *selection_data,
@@ -1267,6 +1295,7 @@ ev_view_init (EvView *view)
        view->current_page = 0;
        view->pressed_button = -1;
        view->cursor = EV_VIEW_CURSOR_NORMAL;
+       view->show_border = TRUE;
 }
 
 static void
@@ -1451,8 +1480,7 @@ page_changed_cb (EvPageCache *page_cache,
                                view->scale,
                                &new_width, &new_height);
 
-       ev_document_misc_get_page_border_size
-               (new_width, new_height, &(view->border));
+       compute_border (view, new_width, new_height, &(view->border));
 
        ev_pixbuf_cache_set_page_range (view->pixbuf_cache,
                                        view->current_page,
index 6cde705df1e3d3adad5b57872bb4acfe67135a28..09c160058232f5fc2e51f65ec927ed26261a9ee4 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_show_border (EvView     *view,
+                                        gboolean    show_border);
 
 /* Find */
 gboolean       ev_view_can_find_next   (EvView     *view);
index fdee542a739c593563c1555423e28a66d5ea6958..182261ca4ade10305096a34b25f5841818fbed28 100644 (file)
@@ -1433,6 +1433,7 @@ ev_window_unfullscreen (EvWindow *window)
 
 //     destroy_fullscreen_popup (window);
 
+       ev_view_set_show_border (EV_VIEW (window->priv->view), TRUE);
        update_chrome_visibility (window);
 }
 
@@ -1450,6 +1451,8 @@ ev_window_cmd_view_fullscreen (GtkAction *action, EvWindow *ev_window)
        } else {
                gtk_window_unfullscreen (GTK_WINDOW (ev_window));
        }
+
+       ev_view_set_show_border (EV_VIEW (ev_window->priv->view), FALSE);
 }
 
 static gboolean