]> www.fi.muni.cz Git - evince.git/commitdiff
[dualscreen] fix paned position - Issue #7
authorxbezdick <255993@mail.muni.cz>
Tue, 3 May 2011 21:03:19 +0000 (23:03 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 1 Jun 2011 11:09:22 +0000 (13:09 +0200)
shell/ev-dualscreen.c
shell/ev-window.c

index 8d474aaa4df5b38d47a6a9769bb181965013b127..5cdefb8423a625cf5076f3e4a5727e0719400876 100644 (file)
@@ -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
index ef6f0b16ac85271cb1e5207cc7d2508e5d60e4fa..30491844ff39d0d9866f3f7301140205b2f38371 100644 (file)
@@ -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