layout: separate keyboard and tray
The keyboard and tray need to animate together, but they sometimes need to be in different stacking layers (eg, from the screensaver you want access to the keyboard, but not the tray). So remove _bottomBox and just keep trayBox and keyboardBox lined up manually. https://bugzilla.gnome.org/show_bug.cgi?id=657986
This commit is contained in:
parent
e79c093d80
commit
627fff967f
@ -40,21 +40,14 @@ LayoutManager.prototype = {
|
|||||||
this.panelBox.connect('allocation-changed',
|
this.panelBox.connect('allocation-changed',
|
||||||
Lang.bind(this, this._updatePanelBarriers));
|
Lang.bind(this, this._updatePanelBarriers));
|
||||||
|
|
||||||
// bottomBox contains the tray and keyboard (which move
|
|
||||||
// together, since the tray slides up from the top of the
|
|
||||||
// keyboard when the keyboard is visible).
|
|
||||||
this._bottomBox = new St.BoxLayout({ name: 'bottomBox',
|
|
||||||
vertical: true });
|
|
||||||
this.addChrome(this._bottomBox, { visibleInFullscreen: true });
|
|
||||||
this._keyboardHeightNotifyId = 0;
|
|
||||||
|
|
||||||
this.trayBox = new St.BoxLayout({ name: 'trayBox' });
|
this.trayBox = new St.BoxLayout({ name: 'trayBox' });
|
||||||
|
this.addChrome(this.trayBox, { visibleInFullscreen: true });
|
||||||
this.trayBox.connect('allocation-changed',
|
this.trayBox.connect('allocation-changed',
|
||||||
Lang.bind(this, this._updateTrayBarrier));
|
Lang.bind(this, this._updateTrayBarrier));
|
||||||
this._bottomBox.add_actor(this.trayBox);
|
|
||||||
|
|
||||||
this.keyboardBox = new St.BoxLayout({ name: 'keyboardBox' });
|
this.keyboardBox = new St.BoxLayout({ name: 'keyboardBox' });
|
||||||
this._bottomBox.add_actor(this.keyboardBox);
|
this.addChrome(this.keyboardBox, { visibleInFullscreen: true });
|
||||||
|
this._keyboardHeightNotifyId = 0;
|
||||||
|
|
||||||
global.screen.connect('monitors-changed',
|
global.screen.connect('monitors-changed',
|
||||||
Lang.bind(this, this._monitorsChanged));
|
Lang.bind(this, this._monitorsChanged));
|
||||||
@ -154,11 +147,13 @@ LayoutManager.prototype = {
|
|||||||
this.panelBox.set_position(this.primaryMonitor.x, this.primaryMonitor.y);
|
this.panelBox.set_position(this.primaryMonitor.x, this.primaryMonitor.y);
|
||||||
this.panelBox.set_size(this.primaryMonitor.width, -1);
|
this.panelBox.set_size(this.primaryMonitor.width, -1);
|
||||||
|
|
||||||
this._bottomBox.set_position(this.bottomMonitor.x,
|
this.keyboardBox.set_position(this.bottomMonitor.x,
|
||||||
this.bottomMonitor.y + this.bottomMonitor.height);
|
this.bottomMonitor.y + this.bottomMonitor.height);
|
||||||
this._bottomBox.set_size(this.bottomMonitor.width, -1);
|
this.keyboardBox.set_size(this.bottomMonitor.width, -1);
|
||||||
|
|
||||||
this.trayBox.width = this.bottomMonitor.width;
|
this.trayBox.set_position(this.bottomMonitor.x,
|
||||||
|
this.bottomMonitor.y + this.bottomMonitor.height);
|
||||||
|
this.trayBox.set_size(this.bottomMonitor.width, -1);
|
||||||
|
|
||||||
// Set trayBox's clip to show things above it, but not below
|
// Set trayBox's clip to show things above it, but not below
|
||||||
// it (so it's not visible behind the keyboard). The exact
|
// it (so it's not visible behind the keyboard). The exact
|
||||||
@ -270,13 +265,18 @@ LayoutManager.prototype = {
|
|||||||
|
|
||||||
showKeyboard: function () {
|
showKeyboard: function () {
|
||||||
Main.messageTray.hide();
|
Main.messageTray.hide();
|
||||||
Tweener.addTween(this._bottomBox,
|
Tweener.addTween(this.keyboardBox,
|
||||||
{ anchor_y: this._bottomBox.height,
|
{ anchor_y: this.keyboardBox.height,
|
||||||
time: KEYBOARD_ANIMATION_TIME,
|
time: KEYBOARD_ANIMATION_TIME,
|
||||||
transition: 'easeOutQuad',
|
transition: 'easeOutQuad',
|
||||||
onComplete: this._showKeyboardComplete,
|
onComplete: this._showKeyboardComplete,
|
||||||
onCompleteScope: this
|
onCompleteScope: this
|
||||||
});
|
});
|
||||||
|
Tweener.addTween(this.trayBox,
|
||||||
|
{ anchor_y: this.keyboardBox.height,
|
||||||
|
time: KEYBOARD_ANIMATION_TIME,
|
||||||
|
transition: 'easeOutQuad'
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_showKeyboardComplete: function() {
|
_showKeyboardComplete: function() {
|
||||||
@ -284,24 +284,30 @@ LayoutManager.prototype = {
|
|||||||
// anchor point changes
|
// anchor point changes
|
||||||
this._chrome.updateRegions();
|
this._chrome.updateRegions();
|
||||||
|
|
||||||
this._keyboardHeightNotifyId = this._bottomBox.connect('notify::height', Lang.bind(this, function () {
|
this._keyboardHeightNotifyId = this.keyboardBox.connect('notify::height', Lang.bind(this, function () {
|
||||||
this._bottomBox.anchor_y = this._bottomBox.height;
|
this.keyboardBox.anchor_y = this.keyboardBox.height;
|
||||||
|
this.trayBox.anchor_y = this.keyboardBox.height;
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
hideKeyboard: function (immediate) {
|
hideKeyboard: function (immediate) {
|
||||||
Main.messageTray.hide();
|
Main.messageTray.hide();
|
||||||
if (this._keyboardHeightNotifyId) {
|
if (this._keyboardHeightNotifyId) {
|
||||||
this._bottomBox.disconnect(this._keyboardHeightNotifyId);
|
this.keyboardBox.disconnect(this._keyboardHeightNotifyId);
|
||||||
this._keyboardHeightNotifyId = 0;
|
this._keyboardHeightNotifyId = 0;
|
||||||
}
|
}
|
||||||
Tweener.addTween(this._bottomBox,
|
Tweener.addTween(this.keyboardBox,
|
||||||
{ anchor_y: 0,
|
{ anchor_y: 0,
|
||||||
time: immediate ? 0 : KEYBOARD_ANIMATION_TIME,
|
time: immediate ? 0 : KEYBOARD_ANIMATION_TIME,
|
||||||
transition: 'easeOutQuad',
|
transition: 'easeOutQuad',
|
||||||
onComplete: this._hideKeyboardComplete,
|
onComplete: this._hideKeyboardComplete,
|
||||||
onCompleteScope: this
|
onCompleteScope: this
|
||||||
});
|
});
|
||||||
|
Tweener.addTween(this.trayBox,
|
||||||
|
{ anchor_y: 0,
|
||||||
|
time: immediate ? 0 : KEYBOARD_ANIMATION_TIME,
|
||||||
|
transition: 'easeOutQuad'
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_hideKeyboardComplete: function() {
|
_hideKeyboardComplete: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user