From 57d0691c3a7c86d4ae737787b5ac95d5b6de31ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Tue, 16 Jan 2024 21:39:15 +0100 Subject: [PATCH] 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: --- js/ui/overviewControls.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js index 43817a862..0fc81d85c 100644 --- a/js/ui/overviewControls.js +++ b/js/ui/overviewControls.js @@ -22,6 +22,8 @@ import * as WorkspacesView from './workspacesView.js'; export const SMALL_WORKSPACE_RATIO = 0.15; const DASH_MAX_HEIGHT_RATIO = 0.15; 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'; @@ -88,13 +90,13 @@ class ControlsManagerLayout extends Clutter.LayoutManager { break; case ControlsState.WINDOW_PICKER: workspaceBox.set_origin(0, - startY + searchHeight + spacing + - thumbnailsHeight + spacing * expandFraction); + startY + searchHeight + Math.round(spacing * THUMBNAILS_SPACING_ADJUSTMENT_TOP) + + thumbnailsHeight + Math.round(spacing * THUMBNAILS_SPACING_ADJUSTMENT_BOTTOM) * expandFraction); workspaceBox.set_size(width, height - dashHeight - spacing - - searchHeight - spacing - - thumbnailsHeight - spacing * expandFraction); + searchHeight - Math.round(spacing * THUMBNAILS_SPACING_ADJUSTMENT_TOP) - + thumbnailsHeight - Math.round(spacing * THUMBNAILS_SPACING_ADJUSTMENT_BOTTOM) * expandFraction); break; case ControlsState.APP_GRID: workspaceBox.set_origin(0, startY + searchHeight + spacing); @@ -188,7 +190,7 @@ class ControlsManagerLayout extends Clutter.LayoutManager { thumbnailsHeight = Math.min( thumbnailsHeight * expandFraction, 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); this._workspacesThumbnails.allocate(childBox); }