From a282f84daaf5547c4f3ae7c44abb8a655c6f0dd7 Mon Sep 17 00:00:00 2001 From: Jonian Guveli Date: Mon, 15 Jan 2018 20:29:34 +0200 Subject: [PATCH] rename create functions to update --- unite@hardpixel.eu/modules/activateWindow.js | 4 ++-- unite@hardpixel.eu/modules/activitiesButton.js | 8 ++++++-- unite@hardpixel.eu/modules/extendLeftBox.js | 4 ++-- unite@hardpixel.eu/modules/messageTray.js | 4 ++-- unite@hardpixel.eu/modules/topIcons.js | 4 ++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/unite@hardpixel.eu/modules/activateWindow.js b/unite@hardpixel.eu/modules/activateWindow.js index 4b71b1e..32a9c95 100644 --- a/unite@hardpixel.eu/modules/activateWindow.js +++ b/unite@hardpixel.eu/modules/activateWindow.js @@ -39,10 +39,10 @@ var ActivateWindow = new Lang.Class({ _toggle: function() { this._enabled = this._settings.get_boolean('autofocus-windows'); - this._enabled ? this._create() : this.destroy(); + this._enabled ? this._activate() : this.destroy(); }, - _create: function() { + _activate: function() { this._connectSignals(); }, diff --git a/unite@hardpixel.eu/modules/activitiesButton.js b/unite@hardpixel.eu/modules/activitiesButton.js index 118b8ca..548f57d 100644 --- a/unite@hardpixel.eu/modules/activitiesButton.js +++ b/unite@hardpixel.eu/modules/activitiesButton.js @@ -30,8 +30,12 @@ var ActivitiesButton = new Lang.Class({ }, _toggle: function() { - this._hidden = this._settings.get_boolean('hide-activities-button'); - this._toggleButton(this._hidden); + this._enabled = this._settings.get_boolean('hide-activities-button'); + this._enabled ? this._activate() : this.destroy(); + }, + + _activate: function() { + this._toggleButton(true); }, destroy: function() { diff --git a/unite@hardpixel.eu/modules/extendLeftBox.js b/unite@hardpixel.eu/modules/extendLeftBox.js index ceda814..67a6812 100644 --- a/unite@hardpixel.eu/modules/extendLeftBox.js +++ b/unite@hardpixel.eu/modules/extendLeftBox.js @@ -86,10 +86,10 @@ var ExtendLeftBox = new Lang.Class({ _toggle: function() { this._enabled = this._settings.get_boolean('extend-left-box'); - this._enabled ? this._create() : this.destroy(); + this._enabled ? this._activate() : this.destroy(); }, - _create: function() { + _activate: function() { this._connnectSignals(); Panel.actor.queue_relayout(); }, diff --git a/unite@hardpixel.eu/modules/messageTray.js b/unite@hardpixel.eu/modules/messageTray.js index 9a81365..db455bf 100644 --- a/unite@hardpixel.eu/modules/messageTray.js +++ b/unite@hardpixel.eu/modules/messageTray.js @@ -12,7 +12,7 @@ var MessageTray = new Lang.Class({ this._container = Main.messageTray._bannerBin; this._settings = Convenience.getSettings(); - this._create(); + this._activate(); this._connectSettings(); }, @@ -50,7 +50,7 @@ var MessageTray = new Lang.Class({ this._container.set_x_align(alignments[this._position]); }, - _create: function () { + _activate: function () { this._updatePosition(); this._updateWidth(); }, diff --git a/unite@hardpixel.eu/modules/topIcons.js b/unite@hardpixel.eu/modules/topIcons.js index ac26c01..ed870a3 100644 --- a/unite@hardpixel.eu/modules/topIcons.js +++ b/unite@hardpixel.eu/modules/topIcons.js @@ -186,10 +186,10 @@ var TopIcons = new Lang.Class({ _toggle: function() { this._enabled = this._settings.get_boolean('show-legacy-tray'); - this._enabled ? this._create() : this.destroy(); + this._enabled ? this._activate() : this.destroy(); }, - _create: function() { + _activate: function() { if (Main.legacyTray) { Mainloop.idle_add(Lang.bind(this, this._moveToPanel)); this._tray.actor.hide();