overviewControls: Reduce spacing around the workspaces minimap

With a previous commit we've made the overall dynamic spacing dynamic, but
the spacing is now a bit much when it comes to the space between search and
workspaces minimap, just as workspaces minimap and large workspaces.

The  minimap should somewhat "squeeze into the empty space" here, so
reduce the spacings above and below it a bit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3278>
This commit is contained in:
Jonas Dreßler 2024-01-16 21:39:15 +01:00 committed by Marge Bot
parent b58119d5c6
commit 57d0691c3a

View File

@ -22,6 +22,8 @@ import * as WorkspacesView from './workspacesView.js';
export const SMALL_WORKSPACE_RATIO = 0.15; export const SMALL_WORKSPACE_RATIO = 0.15;
const DASH_MAX_HEIGHT_RATIO = 0.15; const DASH_MAX_HEIGHT_RATIO = 0.15;
const VERTICAL_SPACING_RATIO = 0.02; const VERTICAL_SPACING_RATIO = 0.02;
const THUMBNAILS_SPACING_ADJUSTMENT_TOP = 0.6;
const THUMBNAILS_SPACING_ADJUSTMENT_BOTTOM = 0.4;
const A11Y_SCHEMA = 'org.gnome.desktop.a11y.keyboard'; const A11Y_SCHEMA = 'org.gnome.desktop.a11y.keyboard';
@ -88,13 +90,13 @@ class ControlsManagerLayout extends Clutter.LayoutManager {
break; break;
case ControlsState.WINDOW_PICKER: case ControlsState.WINDOW_PICKER:
workspaceBox.set_origin(0, workspaceBox.set_origin(0,
startY + searchHeight + spacing + startY + searchHeight + Math.round(spacing * THUMBNAILS_SPACING_ADJUSTMENT_TOP) +
thumbnailsHeight + spacing * expandFraction); thumbnailsHeight + Math.round(spacing * THUMBNAILS_SPACING_ADJUSTMENT_BOTTOM) * expandFraction);
workspaceBox.set_size(width, workspaceBox.set_size(width,
height - height -
dashHeight - spacing - dashHeight - spacing -
searchHeight - spacing - searchHeight - Math.round(spacing * THUMBNAILS_SPACING_ADJUSTMENT_TOP) -
thumbnailsHeight - spacing * expandFraction); thumbnailsHeight - Math.round(spacing * THUMBNAILS_SPACING_ADJUSTMENT_BOTTOM) * expandFraction);
break; break;
case ControlsState.APP_GRID: case ControlsState.APP_GRID:
workspaceBox.set_origin(0, startY + searchHeight + spacing); workspaceBox.set_origin(0, startY + searchHeight + spacing);
@ -188,7 +190,7 @@ class ControlsManagerLayout extends Clutter.LayoutManager {
thumbnailsHeight = Math.min( thumbnailsHeight = Math.min(
thumbnailsHeight * expandFraction, thumbnailsHeight * expandFraction,
height * this._workspacesThumbnails.maxThumbnailScale); height * this._workspacesThumbnails.maxThumbnailScale);
childBox.set_origin(0, startY + searchHeight + spacing); childBox.set_origin(0, startY + searchHeight + Math.round(spacing * THUMBNAILS_SPACING_ADJUSTMENT_TOP));
childBox.set_size(width, thumbnailsHeight); childBox.set_size(width, thumbnailsHeight);
this._workspacesThumbnails.allocate(childBox); this._workspacesThumbnails.allocate(childBox);
} }