+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),
int width;
int height;
GtkBorder border;
+ gboolean show_border;
};
struct _EvViewClass {
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)
{
&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;
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;
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",
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,
view->current_page = 0;
view->pressed_button = -1;
view->cursor = EV_VIEW_CURSOR_NORMAL;
+ view->show_border = TRUE;
}
static void
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,