diff options
author | Owen Taylor <otaylor@redhat.com> | 2004-12-22 04:14:06 (GMT) |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2004-12-22 04:14:06 (GMT) |
commit | 694748d4887f8ffd866ae30c1660e86af2ceafed (patch) | |
tree | 699b42d76bf7f36c7be539c67bc162bb5bd0bc0d /shell | |
parent | 484bd6fc379965a3ad83e758135691d84d595f87 (diff) |
Redo size handling.
Tue Dec 21 23:05:51 2004 Owen Taylor <otaylor@redhat.com>
* backend/ev-document.{h,cc} pdf/xpdf/pdf-document.cc:
Redo size handling.
* shell/ev-view.c: Track the size from the document.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ev-view.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c index 9fbc81a..f52b372 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -147,10 +147,19 @@ static void ev_view_size_request (GtkWidget *widget, GtkRequisition *requisition) { - /* EvView *view = EV_VIEW (widget); */ + EvView *view = EV_VIEW (widget); + + if (GTK_WIDGET_REALIZED (widget)) { + if (view->document) { + ev_document_get_page_size (view->document, + &requisition->width, + &requisition->height); + } else { + requisition->width = 10; + requisition->height = 10; + } + } - requisition->width = 500; - requisition->height = 500; } static void @@ -223,9 +232,17 @@ ev_view_realize (GtkWidget *widget) gdk_window_set_user_data (view->bin_window, widget); gdk_window_show (view->bin_window); - if (view->document) + if (view->document) { ev_document_set_target (view->document, view->bin_window); + /* We can't get page size without a target, so we have to + * queue a size request at realization. Could be fixed + * with EvDocument changes to allow setting a GdkScreen + * without setting a target. + */ + gtk_widget_queue_resize (widget); + } + update_window_backgrounds (view); } |