Skip to content

Commit 90dd795

Browse files
committed
Adapt virtualKeyboard to BoxLayout GObject class.
Not working quite yet..
1 parent 9eaecf0 commit 90dd795

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

js/ui/boxpointer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,9 @@ var BoxPointer = GObject.registerClass({
453453
let alignment = this._arrowAlignment;
454454

455455
let monitor = Main.layoutManager.findMonitorForActor(sourceActor);
456+
this._workArea = {x: monitor.x, y: monitor.y, width: monitor.width, height: monitor.height};
456457

457458
this._sourceAllocation = Cinnamon.util_get_transformed_allocation(sourceActor);
458-
this._workArea = monitor.workArea;
459-
460459
// Position correctly relative to the sourceActor
461460
let sourceNode = sourceActor.get_theme_node();
462461
let sourceContentBox = sourceNode.get_content_box(sourceActor.get_allocation_box());

js/ui/virtualKeyboard.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ Key.prototype = {
7878
y_fill: true,
7979
x_align: St.Align.START });
8080
// Adds style to existing keyboard style to avoid repetition
81-
this._boxPointer.actor.add_style_class_name('keyboard-subkeys');
81+
this._boxPointer.add_style_class_name('keyboard-subkeys');
8282
this._getExtendedKeys();
8383
this.actor._extended_keys = this._extended_keyboard;
84-
this._boxPointer.actor.hide();
85-
Main.layoutManager.addChrome(this._boxPointer.actor, { visibleInFullscreen: true });
84+
this._boxPointer.hide();
85+
Main.layoutManager.addChrome(this._boxPointer, { visibleInFullscreen: true });
8686
}
8787
},
8888

8989
_onDestroy: function() {
9090
if (this._boxPointer) {
91-
this._boxPointer.actor.destroy();
91+
this._boxPointer.destroy();
9292
this._boxPointer = null;
9393
}
9494
},
@@ -127,7 +127,7 @@ Key.prototype = {
127127
key.connect('button-release-event', Lang.bind(this, function () { extended_key.release(); }));
128128
this._extended_keyboard.add(key);
129129
}
130-
this._boxPointer.bin.add_actor(this._extended_keyboard);
130+
this._boxPointer.add_actor(this._extended_keyboard);
131131
},
132132

133133
_onEventCapture: function (actor, event) {
@@ -142,7 +142,7 @@ Key.prototype = {
142142
return false;
143143
}
144144
if (type == Clutter.EventType.BUTTON_PRESS) {
145-
this._boxPointer.actor.hide();
145+
this._boxPointer.hide();
146146
this._ungrab();
147147
return true;
148148
}
@@ -159,9 +159,9 @@ Key.prototype = {
159159
_onShowSubkeysChanged: function () {
160160
if (this._key.show_subkeys) {
161161
this.actor.fake_release();
162-
this._boxPointer.actor.raise_top();
162+
this._boxPointer.raise_top();
163163
this._boxPointer.setPosition(this.actor, 0.5);
164-
this._boxPointer.show(true);
164+
this._boxPointer.show();
165165
this.actor.set_hover(false);
166166
if (!this._grabbed) {
167167
Main.pushModal(this.actor);

0 commit comments

Comments
 (0)