aboutsummaryrefslogtreecommitdiff
path: root/extension.js
diff options
context:
space:
mode:
Diffstat (limited to 'extension.js')
-rw-r--r--extension.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/extension.js b/extension.js
index 7d3d813..55ddfdf 100644
--- a/extension.js
+++ b/extension.js
@@ -50,6 +50,17 @@ OnScreenKeyboardButton.prototype = {
Main.keyboard.show();
}
},
+
+ connect: function() {
+ let _children = Main.panel._centerBox.get_children();
+ Main.panel._centerBox.insert_child_at_index(this.actor, _children.length - 1);
+ Main.panel._centerBox.add(this.actor);
+ },
+
+ disconnect: function() {
+ Main.layoutManager.connect(this._keyboardVisibleId);
+ Main.panel._centerBox.remove_actor(_button.actor);
+ },
};
let _button;
@@ -59,11 +70,9 @@ function init() {
}
function enable() {
- let _children = Main.panel._centerBox.get_children();
- Main.panel._centerBox.insert_child_at_index(_button.actor, _children.length - 1);
- Main.panel._centerBox.add(_button.actor);
+ _button.connect()
}
function disable() {
- Main.panel._centerBox.remove_actor(_button.actor);
+ _button.disconnect();
}