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:
parent
61ce906ef9
commit
e21e6eba94
@ -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 ;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user