1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-13 05:17:48 +03:00

center fillApplets in MainLayout for Justify

--avoid for fillApplets of Main layout to overlap
with surrounding applets from side layouts
This commit is contained in:
Michail Vourlakos 2020-05-14 01:10:57 +03:00
parent 61ce906ef9
commit e21e6eba94

View File

@ -305,7 +305,15 @@ Item {
var halfMainLayout = mainLayout.sizeWithNoFillApplets / 2;
var availableSpaceStart = Math.max(0, root.maxLength/2 - startLayout.sizeWithNoFillApplets - halfMainLayout - root.panelEdgeSpacing/2);
var availableSpaceEnd = Math.max(0, root.maxLength/2 - endLayout.sizeWithNoFillApplets - halfMainLayout - root.panelEdgeSpacing/2);
var availableSpace = availableSpaceStart + availableSpaceEnd - mainLayout.sizeWithNoFillApplets;
var availableSpace;
if (mainLayout.fillApplets === 0){
//! no fill applets in main
availableSpace = availableSpaceStart + availableSpaceEnd - mainLayout.sizeWithNoFillApplets;
} else {
//! use the minimum available space in order to avoid overlaps
availableSpace = 2 * Math.min(availableSpaceStart, availableSpaceEnd) - mainLayout.sizeWithNoFillApplets;
}
var sizePerAppletMain = mainLayout.fillApplets > 0 ? availableSpace / noA : 0 ;