[gnome-documents/wip/ui-changes] preview: also flip controls visibility on adjustment value change
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents/wip/ui-changes] preview: also flip controls visibility on adjustment value change
- Date: Thu, 29 Nov 2012 00:00:15 +0000 (UTC)
commit bc1706db0a8801028a6d2be718440f07ec141ad7
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Nov 28 18:58:09 2012 -0500
preview: also flip controls visibility on adjustment value change
If the adjustment value changes for other reasons than the scrollbar
(e.g because we pressed a keybinding that makes the view scroll), hide
the controls.
src/preview.js | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/preview.js b/src/preview.js
index 7c28c40..6439cba 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -57,6 +57,8 @@ const PreviewView = new Lang.Class({
this.widget.get_style_context().add_class('documents-scrolledwin');
this.widget.get_hscrollbar().connect('button-press-event', Lang.bind(this, this._onScrollbarClick));
this.widget.get_vscrollbar().connect('button-press-event', Lang.bind(this, this._onScrollbarClick));
+ this.widget.get_hadjustment().connect('value-changed', Lang.bind(this, this._onAdjustmentChanged));
+ this.widget.get_vadjustment().connect('value-changed', Lang.bind(this, this._onAdjustmentChanged));
// create thumb bar
this._thumbBar = new PreviewThumbnails(this._model);
@@ -192,6 +194,11 @@ const PreviewView = new Lang.Class({
return false;
},
+ _onAdjustmentChanged: function() {
+ if (this._controlsVisible)
+ this._flipControlsState();
+ },
+
_changeRotation: function(offset) {
let rotation = this._model.get_rotation();
this._model.set_rotation(rotation + offset);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]