mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-30 14:50:12 +03:00
fix applets edge margins calculations
--different applets situations request different margins for indicators and margins between them in order to draw them properly. This fix takes into account when edge margins are disabled from wrapper and in that case the edge margins for these are calculated bettter.
This commit is contained in:
parent
77866ebfe6
commit
54e59e773b
@ -46,8 +46,13 @@ Item{
|
||||
property bool rightSpacer: false
|
||||
|
||||
readonly property bool atEdgeForcingFittsLaw: !isSeparator && !parabolicEffectMarginsEnabled && atScreenEdge
|
||||
readonly property int subtrackedMargins: atEdgeForcingFittsLaw && ((firstAppletInContainer && rightSpacer) || (lastAppletInContainer && !rightSpacer )) ?
|
||||
root.lengthExtMargin + root.lengthIntMargin : 0
|
||||
readonly property int subtrackedMargins: {
|
||||
if (atEdgeForcingFittsLaw && ((firstAppletInContainer && rightSpacer) || (lastAppletInContainer && !rightSpacer ))) {
|
||||
return (wrapperAlias.edgeLengthMarginsDisabled ? root.lengthExtMargin + appletItem.lengthAppletIntMargin : root.lengthExtMargin);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
property real nScale: 0
|
||||
|
||||
|
@ -101,6 +101,8 @@ Item{
|
||||
property bool disableScaleHeight: false
|
||||
property bool editMode: root.inConfigureAppletsMode
|
||||
|
||||
property bool edgeLengthMarginsDisabled: isSeparator || !communicator.lengthMarginsEnabled || !canBeHovered
|
||||
|
||||
property int appletWidth: applet ? applet.width : -1
|
||||
property int appletHeight: applet ? applet.height : -1
|
||||
|
||||
@ -123,7 +125,7 @@ Item{
|
||||
(root.inFullJustify && atScreenEdge && !parabolicEffectMarginsEnabled ? edgeLengthMargins : localLengthMargins) //Fitt's Law
|
||||
|
||||
property int localLengthMargins: isSeparator || !communicator.lengthMarginsEnabled ? 0 : appletItem.lengthAppletFullMargins
|
||||
property int edgeLengthMargins: isSeparator || !communicator.lengthMarginsEnabled || !canBeHovered ? 0 : appletItem.lengthAppletIntMargin * 2
|
||||
property int edgeLengthMargins: edgeLengthMarginsDisabled ? 0 : appletItem.lengthAppletIntMargin * 2
|
||||
|
||||
property real scaledWidth: zoomScaleWidth * (layoutWidth + marginWidth)
|
||||
property real scaledHeight: zoomScaleHeight * (layoutHeight + marginHeight)
|
||||
|
Loading…
x
Reference in New Issue
Block a user