overviewControls: Limit Dash height to 15% of the overview's
Back when the Dash was vertical, the size of each item was calculated solely based on the available height. After making the Dash horizontal, this was swapped by the available width. However, when the height of the Dash decreases, the current code results in never scaling them up ever again. Fix that by making ControlsManagerLayout explicitly pass the maximum Dash sizes. Remove the 'notify::width' handler that served the same purpose. Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3651 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1638>
This commit is contained in:

committed by
Marge Bot

parent
1b51ae150d
commit
c0a4d90847
@ -14,6 +14,7 @@ const WorkspaceThumbnail = imports.ui.workspaceThumbnail;
|
||||
const WorkspacesView = imports.ui.workspacesView;
|
||||
|
||||
const SMALL_WORKSPACE_RATIO = 0.15;
|
||||
const DASH_MAX_HEIGHT_RATIO = 0.15;
|
||||
|
||||
var SIDE_CONTROLS_ANIMATION_TIME = Overview.ANIMATION_TIME;
|
||||
|
||||
@ -118,7 +119,11 @@ class ControlsManagerLayout extends Clutter.BoxLayout {
|
||||
availableHeight -= searchHeight + spacing;
|
||||
|
||||
// Dash
|
||||
const [, dashHeight] = this._dash.get_preferred_height(width);
|
||||
const maxDashHeight = Math.round(box.get_height() * DASH_MAX_HEIGHT_RATIO);
|
||||
this._dash.setMaxSize(width, maxDashHeight);
|
||||
|
||||
let [, dashHeight] = this._dash.get_preferred_height(width);
|
||||
dashHeight = Math.min(dashHeight, maxDashHeight);
|
||||
childBox.set_origin(0, height - dashHeight);
|
||||
childBox.set_size(width, dashHeight);
|
||||
this._dash.allocate(childBox);
|
||||
|
Reference in New Issue
Block a user