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

improvements for margins/paddings

--fix also how firstVisibleIndex is tracked for
AppletContainer(s)
This commit is contained in:
Michail Vourlakos 2019-11-24 21:27:48 +02:00
parent 5c5084f7bb
commit 2577c33b7d
3 changed files with 8 additions and 4 deletions

View File

@ -88,6 +88,10 @@ Item {
property bool lastChildOfEndLayout: index === layoutsContainer.endLayout.lastVisibleIndex property bool lastChildOfEndLayout: index === layoutsContainer.endLayout.lastVisibleIndex
readonly property bool atScreenEdge: { readonly property bool atScreenEdge: {
if (plasmoid.configuration.maxLength!==100 || plasmoid.configuration.offset!==0) {
return false;
}
if (root.isHorizontal) { if (root.isHorizontal) {
if (firstChildOfStartLayout) { if (firstChildOfStartLayout) {
return latteView && latteView.x === latteView.screenGeometry.x; return latteView && latteView.x === latteView.screenGeometry.x;
@ -153,7 +157,7 @@ Item {
is taking all the space needed in order to fill right. For atScreenEdge appplets that should be: applet size + lengthAppletIntMargin + lengthAppletExtMargin. is taking all the space needed in order to fill right. For atScreenEdge appplets that should be: applet size + lengthAppletIntMargin + lengthAppletExtMargin.
The indicator should follow also the applet alignment in this in order to feel right The indicator should follow also the applet alignment in this in order to feel right
*/ */
return atScreenEdge ? lengthAppletIntMargin / 2 /*Fitt's*/ : 2 * lengthAppletIntMargin; return 2 * lengthAppletIntMargin;
} }
property int internalHeightMargins: { property int internalHeightMargins: {
@ -165,7 +169,7 @@ Item {
is taking all the space needed in order to fill right. For atScreenEdge appplets that should be: applet size + lengthAppletIntMargin + lengthAppletExtMargin. is taking all the space needed in order to fill right. For atScreenEdge appplets that should be: applet size + lengthAppletIntMargin + lengthAppletExtMargin.
The indicator should follow also the applet alignment in this in order to feel right The indicator should follow also the applet alignment in this in order to feel right
*/ */
return atScreenEdge ? lengthAppletIntMargin / 2 /*Fitt's*/ : 2 * lengthAppletIntMargin; return 2 * lengthAppletIntMargin;
} }
//! are set by the indicator //! are set by the indicator

View File

@ -47,7 +47,7 @@ Item{
readonly property bool atEdgeForcingFittsLaw: !isSeparator && !parabolicEffectMarginsEnabled && atScreenEdge readonly property bool atEdgeForcingFittsLaw: !isSeparator && !parabolicEffectMarginsEnabled && atScreenEdge
readonly property int subtrackedMargins: atEdgeForcingFittsLaw && ((firstAppletInContainer && rightSpacer) || (lastAppletInContainer && !rightSpacer )) ? readonly property int subtrackedMargins: atEdgeForcingFittsLaw && ((firstAppletInContainer && rightSpacer) || (lastAppletInContainer && !rightSpacer )) ?
root.lengthExtMargin : 0 root.lengthExtMargin + root.lengthIntMargin : 0
property real nScale: 0 property real nScale: 0

View File

@ -104,7 +104,7 @@ Grid {
} }
var ind = -1; var ind = -1;
for (var i=0; i>=children[i].length-1; ++i){ for (var i=0; i<=children.length-1; ++i){
if (children[i] if (children[i]
&& (children[i].index<ind || ind === -1) && (children[i].index<ind || ind === -1)
&& children[i].applet && children[i].applet