]> www.fi.muni.cz Git - evince.git/commitdiff
[dualhead] document model & sidebar testing
authorLukáš Bezdička <255993@mail.muni.cz>
Wed, 6 Apr 2011 23:07:28 +0000 (01:07 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 1 Jun 2011 11:09:21 +0000 (13:09 +0200)
shell/ev-dualscreen.c
shell/ev-window.c

index 740cb8e1241f6da4e6d4c906d22a1dcb1dddc501..d80f74b36d6290183a1a30b47b78d4c632035a80 100644 (file)
@@ -28,6 +28,8 @@
 #include "ev-window.h"
 #include "ev-view.h"
 #include "ev-utils.h"
+#include "ev-sidebar.h"
+#include "ev-sidebar-thumbnails.h"
 
 struct _EvDSCWindowPrivate {
        GtkWidget *main_box;
@@ -239,22 +241,46 @@ ev_dscwindow_init (EvDSCWindow *ev_dscwindow)
        GtkWidget *h = gtk_hpaned_new ();
        GtkWidget *v = gtk_vbox_new (FALSE, 0);
 
-       ev_dscwindow->priv->overview_scrolled_window = GTK_WIDGET (g_object_new (
+       ev_dscwindow->priv->model = ev_document_model_new ();
+
+       ev_dscwindow->priv->overview = ev_sidebar_new ();
+       ev_sidebar_set_model (EV_SIDEBAR (ev_dscwindow->priv->overview),
+                             ev_dscwindow->priv->model);
+       gtk_paned_pack1 (GTK_PANED (h),
+                        ev_dscwindow->priv->overview, FALSE, FALSE);
+       gtk_widget_show (ev_dscwindow->priv->overview);
+
+       /* Stub sidebar, for now */
+
+       GtkWidget *sidebar_widget;
+       sidebar_widget = ev_sidebar_thumbnails_new ();
+       /*ev_window->priv->sidebar_thumbs = sidebar_widget;*/
+       /*g_signal_connect (sidebar_widget,
+                         "notify::main-widget",
+                         G_CALLBACK (sidebar_page_main_widget_update_cb),
+                         ev_window);
+       sidebar_page_main_widget_update_cb (G_OBJECT (sidebar_widget), NULL, ev_window);*/
+       gtk_widget_show (sidebar_widget);
+       ev_sidebar_add_page (EV_SIDEBAR (ev_dscwindow->priv->overview),
+                            sidebar_widget);
+
+/*     ev_dscwindow->priv->overview_scrolled_window = GTK_WIDGET (g_object_new (
                        GTK_TYPE_SCROLLED_WINDOW, "shadow-type", GTK_SHADOW_IN, NULL));
        gtk_box_pack_start (GTK_BOX (v), ev_dscwindow->priv->overview_scrolled_window, TRUE, TRUE, 0);
 
-       ev_dscwindow->priv->model = ev_document_model_new ();
+
        ev_dscwindow->priv->overview = ev_view_new ();
        ev_view_set_page_cache_size (EV_VIEW (ev_dscwindow->priv->overview), PAGE_CACHE_SIZE);
-       ev_view_set_model (EV_VIEW (ev_dscwindow->priv->overview), ev_dscwindow->priv->model);
+       ev_view_set_model (EV_VIEW (ev_dscwindow->priv->overview), ev_dscwindow->priv->model);*/
+
        ev_document_model_set_continuous (ev_dscwindow->priv->model, TRUE);
        ev_document_model_set_dual_page (ev_dscwindow->priv->model, FALSE);
        ev_document_model_set_sizing_mode (ev_dscwindow->priv->model, EV_SIZING_BEST_FIT);
 
 
-       gtk_container_add (GTK_CONTAINER (ev_dscwindow->priv->overview_scrolled_window),
+/*     gtk_container_add (GTK_CONTAINER (ev_dscwindow->priv->overview_scrolled_window),
                                   ev_dscwindow->priv->overview);
-
+       */
 
        GtkWidget *e = gtk_expander_new (_("Expensive features"));
        gtk_expander_set_expanded (GTK_EXPANDER (e), TRUE);
index d76fddc1486dc34ea3276892190e98cd97d904cf..dcc35360e20f2803803eb6619b99172fc24ccf82 100644 (file)
@@ -4003,15 +4003,15 @@ ev_window_view_presentation_focus_out (EvWindow *window)
 static void
 ev_window_run_presentation_wrapper (EvWindow *window)
 {
-       if ( get_num_monitors(GTK_WINDOW(window)) > 1) {
+       /*if ( get_num_monitors(GTK_WINDOW(window)) > 1) {*/
                EvWindow *presentation_window = window;
                EvDSCWindow *control = ev_dscwindow_get_control();
 
                ev_dscwindow_set_presentation (control, presentation_window,
                                                presentation_window->priv->document);
                gtk_window_present (GTK_WINDOW (control));
-       } else
-               ev_window_run_presentation (window);
+       /*} else
+               ev_window_run_presentation (window);*/
 
 }
 static void