From bfd72413d9da1ee54fbd9ff172c9a299573e4df8 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 17 Nov 2019 09:23:17 +0200 Subject: [PATCH] show a smaller indicator for atScreenEdge applets --this is a temporary fix in order to provide a visually pleasant result until the final fix for Fitt's law is applied. --- .../package/contents/ui/applet/AppletItem.qml | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/containment/package/contents/ui/applet/AppletItem.qml b/containment/package/contents/ui/applet/AppletItem.qml index 826cc3b34..36c1c1b95 100644 --- a/containment/package/contents/ui/applet/AppletItem.qml +++ b/containment/package/contents/ui/applet/AppletItem.qml @@ -144,8 +144,29 @@ Item { property int lengthAppletFullMargin: lengthAppletIntMargin + root.lengthExtMargin property int lengthAppletFullMargins: 2 * lengthAppletFullMargin - property int internalWidthMargins: root.isVertical ? root.thickMargins : 2 * lengthAppletIntMargin - property int internalHeightMargins: root.isHorizontal ? root.thickMargins : 2 * lengthAppletIntMargin + property int internalWidthMargins: { + if (root.isVertical) { + return root.thickMargins; + } + + /*TODO, Fitt's case: is temporary until the atScreenEdge applets are aligned properly to the corner and the wrapper + 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 + */ + return atScreenEdge ? lengthAppletIntMargin / 2 /*Fitt's*/ : 2 * lengthAppletIntMargin; + } + + property int internalHeightMargins: { + if (root.isHorizontal) { + return root.thickMargins; + } + + /*TODO,Fitt's case: is temporary until the atScreenEdge applets are aligned properly to the corner and the wrapper + 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 + */ + return atScreenEdge ? lengthAppletIntMargin / 2 /*Fitt's*/ : 2 * lengthAppletIntMargin; + } //! are set by the indicator property int iconOffsetX: 0