From 0a771531e17f8fbcbc94b3a738cb45f5e60ad96f Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 21 May 2017 15:22:47 +0300 Subject: [PATCH] fix #480,support new internal separator architect --the internal separator codebase has been simplified a lot and uses a new approach that provides a smoother parabolic effect. This is part1 concerning improve separators, in part2 applets separator will to try to be improved --- .../package/contents/ui/applet/AppletItem.qml | 34 +++++++++++------- .../contents/ui/applet/AppletItemWrapper.qml | 35 +++---------------- .../package/contents/ui/task/TaskDelegate.qml | 25 +++++++++++-- 3 files changed, 49 insertions(+), 45 deletions(-) diff --git a/containment/package/contents/ui/applet/AppletItem.qml b/containment/package/contents/ui/applet/AppletItem.qml index d99325a71..047e1e445 100644 --- a/containment/package/contents/ui/applet/AppletItem.qml +++ b/containment/package/contents/ui/applet/AppletItem.qml @@ -391,9 +391,13 @@ Item { height: root.isHorizontal ? wrapper.height : nHiddenSize ///check also if this is the first plasmoid in anylayout - visible: container.startEdge + visible: container.startEdge || separatorSpace>0 + + //in case there is a neighbour internal separator + property int separatorSpace: (root.latteApplet && (root.latteApplet.internalSeparatorPos === root.tasksCount-1) && index===root.latteAppletPos+1) ? + (2+root.iconMargin/2) : 0 + property real nHiddenSize: (nScale > 0) ? (container.spacersMaxSize * nScale) + separatorSpace : separatorSpace - property real nHiddenSize: (nScale > 0) ? container.spacersMaxSize * nScale : 0 property real nScale: 0 Behavior on nScale { @@ -407,13 +411,14 @@ Item { } Loader{ - anchors.fill: parent + width: !root.isVertical ? parent.width : 1 + height: !root.isVertical ? 1 : parent.height + x: root.isVertical ? parent.width /2 : 0 + y: !root.isVertical ? parent.height /2 : 0 + active: root.debugMode sourceComponent: Rectangle{ - height: 1 - width: parent.width - y: parent.width/2 border.width: 1 border.color: "red" color: "transparent" @@ -432,9 +437,13 @@ Item { height: root.isHorizontal ? wrapper.height : nHiddenSize //check if this last plasmoid in any layout - visible: container.endEdge + visible: container.endEdge || separatorSpace>0 + + //in case there is a neighbour internal separator + property int separatorSpace: (root.latteApplet && root.latteApplet.internalSeparatorPos === 0 && index===root.latteAppletPos-1) ? + (2+root.iconMargin/2) : 0 + property real nHiddenSize: (nScale > 0) ? (container.spacersMaxSize * nScale) + separatorSpace : separatorSpace - property real nHiddenSize: (nScale > 0) ? (container.spacersMaxSize * nScale) : 0 property real nScale: 0 Behavior on nScale { @@ -448,13 +457,14 @@ Item { } Loader{ - anchors.fill: parent + width: !root.isVertical ? parent.width : 1 + height: !root.isVertical ? 1 : parent.height + x: root.isVertical ? parent.width /2 : 0 + y: !root.isVertical ? parent.height /2 : 0 + active: root.debugMode sourceComponent: Rectangle{ - height: 1 - width: parent.width - y: parent.width/2 border.width: 1 border.color: "red" color: "transparent" diff --git a/containment/package/contents/ui/applet/AppletItemWrapper.qml b/containment/package/contents/ui/applet/AppletItemWrapper.qml index 26ec078a9..579ccf754 100644 --- a/containment/package/contents/ui/applet/AppletItemWrapper.qml +++ b/containment/package/contents/ui/applet/AppletItemWrapper.qml @@ -641,20 +641,6 @@ Item{ leftScale = bigNeighbourZoom; } - //! compute the neighbour separator scales - var bsNeighbourZoom = 1; - var ssNeighbourZoom = 1; - - if(root.latteApplet && root.latteApplet.internalSeparatorPos>=0) { - var latApp = root.latteApplet; - if((latApp.internalSeparatorPos === 0) || (latApp.internalSeparatorPos === root.tasksCount-1) ){ - var sepZoomDifference = (5+root.iconMargin) / root.realSize; - - bsNeighbourZoom = Math.max(1,bigNeighbourZoom - sepZoomDifference); - ssNeighbourZoom = Math.max(1,smallNeighbourZoom - sepZoomDifference); - } - } - if(!root.latteApplet || Math.abs(root.latteAppletPos-index)>1 || !root.hasInternalSeparator || (root.hasInternalSeparator && ((root.latteApplet.internalSeparatorPos>0 && root.latteApplet.internalSeparatorPos 0) //in case there is a neighbour separator property int separatorSpace: (root.hasInternalSeparator && root.internalSeparatorPos === index-1) ? @@ -288,7 +307,7 @@ MouseArea{ width: root.vertical ? wrapper.width : nHiddenSize height: root.vertical ? nHiddenSize : wrapper.height - visible: (index === icList.count - 1) || (root.hasInternalSeparator && root.internalSeparatorPos === index+1) + visible: (index === icList.count - 1) || (separatorSpace > 0) //in case there is a neighbour separator property int separatorSpace: (root.hasInternalSeparator && root.internalSeparatorPos === index+1) ?