[gnome-documents/wip/ui-changes] preview: always show navigation bar



commit 9e1e58ab2ad596acffa0a78597dfe5e66d5ba777
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Nov 28 17:19:08 2012 -0500

    preview: always show navigation bar
    
    Left to implement: hide/show it when clicking on the view.

 src/embed.js           |    2 +-
 src/lib/gd-thumb-nav.c |    2 --
 src/preview.js         |   25 +++++++++++++++----------
 3 files changed, 16 insertions(+), 13 deletions(-)
---
diff --git a/src/embed.js b/src/embed.js
index 0370974..2b54f67 100644
--- a/src/embed.js
+++ b/src/embed.js
@@ -375,7 +375,7 @@ const Embed = new Lang.Class({
         this._view = new View.ViewContainer();
         this._viewPage = this._notebook.append_page(this._view.widget, null);
 
-        this._preview = new Preview.PreviewView();
+        this._preview = new Preview.PreviewView(this._overlayLayout);
         this._previewPage = this._notebook.append_page(this._preview.widget, null);
 
         Global.modeController.connect('window-mode-changed',
diff --git a/src/lib/gd-thumb-nav.c b/src/lib/gd-thumb-nav.c
index 738cc95..6d742cf 100644
--- a/src/lib/gd-thumb-nav.c
+++ b/src/lib/gd-thumb-nav.c
@@ -360,8 +360,6 @@ gd_thumb_nav_init (GdThumbNav *nav)
 			  nav);
 
 	priv->sw = gtk_scrolled_window_new (NULL, NULL);
-	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (priv->sw),
-					     GTK_SHADOW_IN);
         gtk_box_pack_start (GTK_BOX (nav), priv->sw, TRUE, TRUE, 0);
 
 	g_signal_connect (priv->sw,
diff --git a/src/preview.js b/src/preview.js
index 053cba5..67acb7a 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -35,6 +35,7 @@ const Global = imports.global;
 const Tweener = imports.util.tweener;
 const MainToolbar = imports.mainToolbar;
 const Searchbar = imports.searchbar;
+const Utils = imports.utils;
 const View = imports.view;
 
 const _FULLSCREEN_TOOLBAR_TIMEOUT = 2; // seconds
@@ -42,7 +43,7 @@ const _FULLSCREEN_TOOLBAR_TIMEOUT = 2; // seconds
 const PreviewView = new Lang.Class({
     Name: 'PreviewView',
 
-    _init: function() {
+    _init: function(overlayLayout) {
         this._model = null;
         this._jobFind = null;
 
@@ -51,6 +52,11 @@ const PreviewView = new Lang.Class({
                                                shadow_type: Gtk.ShadowType.IN });
         this.widget.get_style_context().add_class('documents-scrolledwin');
 
+        // create thumb bar
+        this._thumbBar = new PreviewThumbnails(this._model);
+        overlayLayout.add(this._thumbBar.actor,
+            Clutter.BinAlignment.FILL, Clutter.BinAlignment.END);
+
         this._createView();
         this.widget.show_all();
 
@@ -182,14 +188,18 @@ const PreviewView = new Lang.Class({
         if (this._model == model)
             return;
 
-        if (this.view)
+        if (this.view) {
             this.view.destroy();
+            this._thumbBar.hide();
+        }
 
         this._model = model;
 
         if (this._model) {
             this._createView();
             this.view.set_model(this._model);
+            this._thumbBar.view.model = model;
+            this._thumbBar.show();
         }
     },
 
@@ -205,14 +215,17 @@ const PreviewThumbnails = new Lang.Class({
         this.view = new GdPrivate.SidebarThumbnails({ model: model });
         this.widget = new GdPrivate.ThumbNav({ thumbview: this.view,
                                                show_buttons: false });
+        this.widget.get_style_context().add_class('osd');
         this.actor = new GtkClutter.Actor({ contents: this.widget,
                                             opacity: 0 });
+        Utils.alphaGtkWidget(this.actor.get_widget());
 
         this.widget.show_all();
     },
 
     show: function() {
         this.actor.show();
+        log('show');
 
         Tweener.addTween(this.actor,
             { opacity: 255,
@@ -244,11 +257,6 @@ const PreviewFullscreen = new Lang.Class({
         this._filter.connect('motion-event', Lang.bind(this, this._fullscreenMotionHandler));
         this._filter.start();
 
-        // create thumb bar
-        this._thumbBar = new PreviewThumbnails(model);
-        layout.add(this._thumbBar.actor,
-            Clutter.BinAlignment.FILL, Clutter.BinAlignment.END);
-
         // create toolbar
         this._fsToolbar = new PreviewFullscreenToolbar(previewView);
         this._fsToolbar.setModel(model);
@@ -282,18 +290,15 @@ const PreviewFullscreen = new Lang.Class({
 
         this._filter.stop();
 
-        this._thumbBar.actor.destroy();
         this._fsToolbar.actor.destroy();
     },
 
     _show: function() {
         this._fsToolbar.show();
-        this._thumbBar.show();
     },
 
     _hide: function() {
         this._fsToolbar.hide();
-        this._thumbBar.hide();
     },
 
     _fullscreenMotionHandler: function() {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]