From 3f88341bcbbab0d88dd1f14c288096856b01c3b4 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 7 Jun 2019 18:19:44 +0300 Subject: [PATCH] restore Fitt's Law for edge Applets --when the Latte View is in Justify mode and and an applet is touching the screen edge then for that applet any margins from the Screen edge should be removed. That way the Fitt's Law is obeyed. What is going to happen for the margins of these applets with their neighbour applets will be considered in the future. BUG: 408412 --- containment/package/contents/ui/applet/ItemWrapper.qml | 10 +++++++--- .../package/contents/ui/applet/indicator/Loader.qml | 10 ++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/containment/package/contents/ui/applet/ItemWrapper.qml b/containment/package/contents/ui/applet/ItemWrapper.qml index ae38dcc0c..ba69970fc 100644 --- a/containment/package/contents/ui/applet/ItemWrapper.qml +++ b/containment/package/contents/ui/applet/ItemWrapper.qml @@ -115,8 +115,12 @@ Item{ property int iconSize: root.iconSize - property int marginWidth: root.isVertical ? root.thickMargins : localLengthMargins - property int marginHeight: root.isHorizontal ? root.thickMargins : localLengthMargins + property int marginWidth: root.isVertical ? + root.thickMargins : + (root.inFullJustify && atScreenEdge ? 0 : localLengthMargins) //Fitt's Law + property int marginHeight: root.isHorizontal ? + root.thickMargins : + (root.inFullJustify && atScreenEdge ? 0 : localLengthMargins) //Fitt's Law property int localLengthMargins: isSpacer || isSeparator ? 0 : root.lengthMargins @@ -210,7 +214,7 @@ Item{ updateLayoutWidth(); } - onAppletMinimumHeightChanged: { + onAppletMinimumHeightChanged: { if(zoomScale === 1) { checkCanBeHovered(); } diff --git a/containment/package/contents/ui/applet/indicator/Loader.qml b/containment/package/contents/ui/applet/indicator/Loader.qml index 94b2af755..5c270dc46 100644 --- a/containment/package/contents/ui/applet/indicator/Loader.qml +++ b/containment/package/contents/ui/applet/indicator/Loader.qml @@ -42,11 +42,13 @@ Loader { return indicators.indicatorComponent; } - width: root.isHorizontal ? appletItem.wrapperAlias.width - 2*appletItem.wrapperAlias.zoomScale*root.lengthExtMargin - : appletItem.wrapperAlias.width; + width: root.isHorizontal && !(root.inFullJustify && atScreenEdge /*Fitt's Law*/) ? + appletItem.wrapperAlias.width - 2*appletItem.wrapperAlias.zoomScale*root.lengthExtMargin + : appletItem.wrapperAlias.width - height: root.isVertical ? appletItem.wrapperAlias.height - 2*appletItem.wrapperAlias.zoomScale*root.lengthExtMargin : - appletItem.wrapperAlias.height; + height: root.isVertical && !(root.inFullJustify && atScreenEdge /*Fitt's Law*/) ? + appletItem.wrapperAlias.height - 2*appletItem.wrapperAlias.zoomScale*root.lengthExtMargin : + appletItem.wrapperAlias.height readonly property bool locked: appletItem.lockZoom || root.zoomFactor === 1