From e15a7596cedb2c211df936d9ca01da3a53814d08 Mon Sep 17 00:00:00 2001 From: xbezdick <255993@mail.muni.cz> Date: Tue, 3 May 2011 23:03:19 +0200 Subject: [PATCH] [dualscreen] fix paned position - Issue #7 --- shell/ev-dualscreen.c | 15 +++++++-------- shell/ev-window.c | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/shell/ev-dualscreen.c b/shell/ev-dualscreen.c index 8d474aaa..5cdefb84 100644 --- a/shell/ev-dualscreen.c +++ b/shell/ev-dualscreen.c @@ -62,7 +62,7 @@ struct _EvDSCWindowPrivate { #define EV_DSCWINDOW_GET_PRIVATE(object) \ (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_DSCWINDOW, EvDSCWindowPrivate)) #define PAGE_CACHE_SIZE 52428800 /* 50MB */ -#define SIDEBAR_DEFAULT_SIZE 300 +#define SIDEBAR_DEFAULT_SIZE 21 /* This seems like bug in gtk to me */ #define MAX_PRESENTATION_TIME 1440 /*60*24 ONE DAY*/ G_DEFINE_TYPE (EvDSCWindow, ev_dscwindow, GTK_TYPE_WINDOW) @@ -298,16 +298,13 @@ ev_dscwindow_init (EvDSCWindow *ev_dscwindow) ev_dscwindow->priv->notesview_scrolled_window = GTK_WIDGET ( g_object_new (GTK_TYPE_SCROLLED_WINDOW,"shadow-type", GTK_SHADOW_IN, NULL)); - gtk_paned_pack1 (GTK_PANED (hpaned), ev_dscwindow->priv->sidebar, FALSE, TRUE); - gtk_paned_pack2 (GTK_PANED (hpaned), ev_dscwindow->priv->notesview_scrolled_window, TRUE, TRUE); - gtk_paned_set_position (GTK_PANED (hpaned), SIDEBAR_DEFAULT_SIZE); - ev_dscwindow->priv->notesview = ev_view_new (); gtk_container_add (GTK_CONTAINER (ev_dscwindow->priv->notesview_scrolled_window), ev_dscwindow->priv->notesview); - ev_dscwindow->priv->notes_model = ev_dscwindow->priv->model; ev_view_set_model (EV_VIEW (ev_dscwindow->priv->notesview), ev_dscwindow->priv->notes_model); + gtk_paned_pack1 (GTK_PANED (hpaned), ev_dscwindow->priv->sidebar, FALSE, TRUE); + gtk_paned_pack2 (GTK_PANED (hpaned), ev_dscwindow->priv->notesview_scrolled_window, FALSE, FALSE); gtk_box_pack_start(GTK_BOX(vbox),hpaned,TRUE,TRUE,0); @@ -355,11 +352,13 @@ ev_dscwindow_init (EvDSCWindow *ev_dscwindow) GtkWidget *hpan = gtk_hpaned_new (); gtk_paned_pack1 (GTK_PANED(hpan), expander, FALSE, TRUE); ev_dscwindow->priv->timer = ev_presentation_timer_new (); - gtk_paned_pack2 (GTK_PANED(hpan),ev_dscwindow->priv->timer, TRUE, TRUE); - gtk_paned_set_position (GTK_PANED (hpan), SIDEBAR_DEFAULT_SIZE); + gtk_paned_pack2 (GTK_PANED(hpan),ev_dscwindow->priv->timer, FALSE, FALSE); + gtk_box_pack_end (GTK_BOX (vbox), hpan, FALSE, TRUE, 0); gtk_container_add (GTK_CONTAINER (ev_dscwindow), vbox); gtk_widget_show_all(vbox); + gtk_paned_set_position (GTK_PANED (hpan), SIDEBAR_DEFAULT_SIZE); + gtk_paned_set_position (GTK_PANED (hpaned), SIDEBAR_DEFAULT_SIZE); } static void diff --git a/shell/ev-window.c b/shell/ev-window.c index ef6f0b16..30491844 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -4053,13 +4053,13 @@ ev_window_run_presentation (EvWindow *window) if (window->priv->metadata && !ev_window_is_empty (window)) ev_metadata_set_boolean (window->priv->metadata, "presentation", TRUE); - if ( get_num_monitors(GTK_WINDOW(window)) > 1) { + //if ( get_num_monitors(GTK_WINDOW(window)) > 1) { EvDSCWindow *control = ev_dscwindow_get_control(); gtk_window_present (GTK_WINDOW (control)); ev_dscwindow_set_presentation (control, window, window->priv->document, EV_VIEW_PRESENTATION(window->priv->presentation_view)); - } + //} } void -- 2.43.5