[sushi/wip/cosimoc/no-clutter: 42/50] Make moveOnClick() a property of the Renderer interface
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sushi/wip/cosimoc/no-clutter: 42/50] Make moveOnClick() a property of the Renderer interface
- Date: Mon, 17 Jun 2019 18:36:08 +0000 (UTC)
commit ed251e7950a3c76f8bea4da0e7df6df7c1d53e9f
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sat Jun 15 12:19:42 2019 -0700
Make moveOnClick() a property of the Renderer interface
Clean things up.
src/ui/fallbackRenderer.js | 1 -
src/ui/renderer.js | 4 ++++
src/viewers/audio.js | 1 -
src/viewers/evince.js | 5 ++++-
src/viewers/font.js | 1 -
src/viewers/gst.js | 1 -
src/viewers/html.js | 5 ++++-
src/viewers/image.js | 1 -
src/viewers/text.js | 5 ++++-
9 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/src/ui/fallbackRenderer.js b/src/ui/fallbackRenderer.js
index 9503649..62c13ad 100644
--- a/src/ui/fallbackRenderer.js
+++ b/src/ui/fallbackRenderer.js
@@ -39,7 +39,6 @@ var FallbackRenderer = GObject.registerClass({
super._init({ orientation: Gtk.Orientation.HORIZONTAL,
spacing: 6 });
- this.moveOnClick = true;
this.canFullScreen = false;
this._fileLoader = new Sushi.FileLoader();
diff --git a/src/ui/renderer.js b/src/ui/renderer.js
index 269974c..17aafa2 100644
--- a/src/ui/renderer.js
+++ b/src/ui/renderer.js
@@ -20,6 +20,10 @@ var Renderer = GObject.registerClass({
this.notify('ready');
}
+ get moveOnClick() {
+ return true;
+ }
+
get ready() {
return !!this._ready;
}
diff --git a/src/viewers/audio.js b/src/viewers/audio.js
index 118e7d5..6240752 100644
--- a/src/viewers/audio.js
+++ b/src/viewers/audio.js
@@ -59,7 +59,6 @@ var Klass = GObject.registerClass({
super._init({ orientation: Gtk.Orientation.HORIZONTAL,
spacing: 6 });
- this.moveOnClick = true;
this.canFullScreen = false;
this._mainWindow = mainWindow;
diff --git a/src/viewers/evince.js b/src/viewers/evince.js
index cf481a9..f2c660e 100644
--- a/src/viewers/evince.js
+++ b/src/viewers/evince.js
@@ -42,7 +42,6 @@ var Klass = GObject.registerClass({
min_content_height: Constants.VIEW_MIN,
min_content_width: Constants.VIEW_MIN });
- this.moveOnClick = false;
this.canFullScreen = true;
this._mainWindow = mainWindow;
@@ -81,6 +80,10 @@ var Klass = GObject.registerClass({
this._view.set_model(this._model);
}
+ get moveOnClick() {
+ return false;
+ }
+
populateToolbar(toolbar) {
this._toolbarBack = Utils.createToolButton('go-previous-symbolic', () => {
this._view.previous_page();
diff --git a/src/viewers/font.js b/src/viewers/font.js
index 9eee4cc..242a832 100644
--- a/src/viewers/font.js
+++ b/src/viewers/font.js
@@ -39,7 +39,6 @@ var Klass = GObject.registerClass({
super._init({ uri: file.get_uri(),
visible: true })
- this.moveOnClick = true;
this.canFullScreen = true;
this.isReady();
diff --git a/src/viewers/gst.js b/src/viewers/gst.js
index f3537e6..6843c5d 100644
--- a/src/viewers/gst.js
+++ b/src/viewers/gst.js
@@ -40,7 +40,6 @@ var Klass = GObject.registerClass({
_init(file) {
super._init({ uri: file.get_uri() });
- this.moveOnClick = true;
// fullscreen is handled internally by the widget
this.canFullScreen = false;
diff --git a/src/viewers/html.js b/src/viewers/html.js
index 0bb7148..dfae974 100644
--- a/src/viewers/html.js
+++ b/src/viewers/html.js
@@ -39,7 +39,6 @@ var Klass = GObject.registerClass({
_init(file, mainWindow) {
super._init();
- this.moveOnClick = false;
this.canFullScreen = true;
this._mainWindow = mainWindow;
@@ -53,6 +52,10 @@ var Klass = GObject.registerClass({
this.isReady();
}
+ get moveOnClick() {
+ return false;
+ }
+
populateToolbar(toolbar) {
let toolbarZoom = Utils.createFullScreenButton(this._mainWindow);
toolbar.add(toolbarZoom);
diff --git a/src/viewers/image.js b/src/viewers/image.js
index bc75e70..3c22c24 100644
--- a/src/viewers/image.js
+++ b/src/viewers/image.js
@@ -127,7 +127,6 @@ var Klass = GObject.registerClass({
super._init();
this._timeoutId = 0;
- this.moveOnClick = true;
this.canFullScreen = true;
this._mainWindow = mainWindow;
diff --git a/src/viewers/text.js b/src/viewers/text.js
index 240e6f5..2a45a74 100644
--- a/src/viewers/text.js
+++ b/src/viewers/text.js
@@ -53,7 +53,6 @@ var Klass = GObject.registerClass({
_init(file, mainWindow) {
super._init();
- this.moveOnClick = false;
this.canFullScreen = true;
this._mainWindow = mainWindow;
this._file = file;
@@ -91,6 +90,10 @@ var Klass = GObject.registerClass({
this._view.set_show_line_numbers(true);
}
+ get moveOnClick() {
+ return false;
+ }
+
populateToolbar(toolbar) {
let toolbarRun = Utils.createOpenButton(this._file, this._mainWindow);
toolbar.add(toolbarRun);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]