[gnome-documents] preview: always show navigation bar
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] preview: always show navigation bar
- Date: Thu, 13 Dec 2012 14:03:17 +0000 (UTC)
commit a903fa3e9112a7b839a226ea17b0ccfbb8261003
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 aaaaf52..06bfe7f 100644
--- a/src/embed.js
+++ b/src/embed.js
@@ -374,7 +374,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);
Application.modeController.connect('window-mode-changed',
diff --git a/src/lib/gd-thumb-nav.c b/src/lib/gd-thumb-nav.c
index fd4e018..28f455d 100644
--- a/src/lib/gd-thumb-nav.c
+++ b/src/lib/gd-thumb-nav.c
@@ -359,8 +359,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 61beeba..66a5c01 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -35,6 +35,7 @@ const Application = imports.application;
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;
@@ -52,6 +53,12 @@ const PreviewView = new Lang.Class({
this.widget.get_style_context().add_class('documents-scrolledwin');
this._createView();
+
+ // create thumb bar
+ this._thumbBar = new PreviewThumbnails(this._model);
+ overlayLayout.add(this._thumbBar.actor,
+ Clutter.BinAlignment.FILL, Clutter.BinAlignment.END);
+
this.widget.show_all();
this._zoomIn = Application.application.lookup_action('zoom-in');
@@ -182,14 +189,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();
}
},
@@ -206,8 +217,10 @@ const PreviewThumbnails = new Lang.Class({
visible: true });
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();
},
@@ -245,11 +258,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);
@@ -283,18 +291,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]