improvements for margins/paddings

--fix also how firstVisibleIndex is tracked for
AppletContainer(s)
pull/16/head
Michail Vourlakos 5 years ago
parent 8efc9bed70
commit b31bf99673

@ -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

@ -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

@ -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

Loading…
Cancel
Save