Skip to content

Commit

Permalink
docking: Be more consistent in reducing the overlay layout space
Browse files Browse the repository at this point in the history
We used different behavior depending on the state, but we can just be
consistent and reduce the vertical space used in the same way
  • Loading branch information
3v1n0 committed Jun 2, 2023
1 parent 4a7f3a6 commit 2bdc7ee
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions docking.js
Original file line number Diff line number Diff line change
Expand Up @@ -2306,17 +2306,13 @@ var DockManager = class DashToDockDockManager {
box.y1 += spacing;

box.y2 -= searchBox.get_height() + spacing;

if (!wsThumbnails && this.mainDock.position === St.Side.BOTTOM)
box.y2 -= spacing;
box.y2 -= spacing;
}

return box;
};

const maybeAdjustBoxToDock = (state, box, spacing) => {
const initialRatio = box.get_width() / box.get_height();

maybeAdjustBoxSize(state, box, spacing);

if (this.mainDock.isHorizontal || this.settings.dockFixed)
Expand All @@ -2330,11 +2326,6 @@ var DockManager = class DashToDockDockManager {
else if (this.mainDock.position === St.Side.RIGHT)
box.x2 -= preferredWidth;

// Reduce the box height too, to keep the initial proportions
const heightAdjustment = (preferredWidth / initialRatio) / 2;
box.y1 += heightAdjustment;
box.y2 -= heightAdjustment;

return box;
};

Expand Down

0 comments on commit 2bdc7ee

Please sign in to comment.