overviewControls: Make AppDisplay rise from the bottom

It makes more sense in a spatial overview that the app grid
comes and goes to somewhere in the screen, instead of fading
in and out into the void.

Make the app grid rise from the bottom of the screen.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
This commit is contained in:
Georges Basile Stavracas Neto 2021-01-20 19:25:13 -03:00 committed by Marge Bot
parent a9f11b1f5a
commit 87645652e5

View File

@ -69,6 +69,31 @@ class ControlsManagerLayout extends Clutter.BoxLayout {
return workspaceBox; return workspaceBox;
} }
_getAppDisplayBoxForState(state, box, searchHeight, dashHeight, appGridBox) {
const [width, height] = box.get_size();
const appDisplayBox = new Clutter.ActorBox();
const { spacing } = this;
switch (state) {
case ControlsState.HIDDEN:
case ControlsState.WINDOW_PICKER:
appDisplayBox.set_origin(0, box.y2);
break;
case ControlsState.APP_GRID:
appDisplayBox.set_origin(0,
searchHeight + spacing + appGridBox.get_height());
break;
}
appDisplayBox.set_size(width,
height -
searchHeight - spacing -
appGridBox.get_height() - spacing -
dashHeight);
return appDisplayBox;
}
vfunc_set_container(container) { vfunc_set_container(container) {
this._container = container; this._container = container;
this.hookup_style(container); this.hookup_style(container);
@ -112,7 +137,7 @@ class ControlsManagerLayout extends Clutter.BoxLayout {
} }
// Workspaces // Workspaces
const params = [box, searchHeight, dashHeight, thumbnailsHeight]; let params = [box, searchHeight, dashHeight, thumbnailsHeight];
const transitionParams = this._stateAdjustment.getStateTransitionParams(); const transitionParams = this._stateAdjustment.getStateTransitionParams();
let workspacesBox; let workspacesBox;
@ -133,14 +158,20 @@ class ControlsManagerLayout extends Clutter.BoxLayout {
const workspaceAppGridBox = const workspaceAppGridBox =
this._getWorkspacesBoxForState(ControlsState.APP_GRID, ...params); this._getWorkspacesBoxForState(ControlsState.APP_GRID, ...params);
childBox.set_origin(0, searchHeight + spacing + workspaceAppGridBox.get_height()); params = [box, searchHeight, dashHeight, workspaceAppGridBox];
childBox.set_size(width, let appDisplayBox;
height - if (!transitionParams.transitioning) {
searchHeight - spacing - appDisplayBox =
workspaceAppGridBox.get_height() - spacing - this._getAppDisplayBoxForState(transitionParams.currentState, ...params);
dashHeight); } else {
const initialBox =
this._getAppDisplayBoxForState(transitionParams.initialState, ...params);
const finalBox =
this._getAppDisplayBoxForState(transitionParams.finalState, ...params);
this._appDisplay.allocate(childBox); appDisplayBox = initialBox.interpolate(finalBox, transitionParams.progress);
}
this._appDisplay.allocate(appDisplayBox);
// ViewSelector // ViewSelector
childBox.set_origin(0, searchHeight + spacing); childBox.set_origin(0, searchHeight + spacing);