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
pull/1/head
Michail Vourlakos 8 years ago
parent 008c57d480
commit 0a771531e1

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

@ -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<root.tasksCount-1)
@ -667,26 +653,15 @@ Item{
updateIdSendScale(index-2, 1, 0);
updateIdSendScale(index+2, 1 ,0);
} else{
if(latApp.internalSeparatorPos === 0){
if (!positiveDirection) {
updateIdSendScale(index+2, ssNeighbourZoom, 0);
} else {
updateIdSendScale(index+2, bsNeighbourZoom, 0);
}
if(root.latteApplet.internalSeparatorPos === 0){
updateIdSendScale(index+2, rightScale, 0);
updateIdSendScale(index-1, leftScale, 0);
updateIdSendScale(index+1, rightScale, 0);
updateIdSendScale(index+3, 1, 0);
updateIdSendScale(index-2, 1, 0);
} else if(root.hasInternalSeparator && latApp.internalSeparatorPos === root.tasksCount-1) {
if (!positiveDirection) {
updateIdSendScale(index-2, bsNeighbourZoom, 0);
} else {
updateIdSendScale(index-2, ssNeighbourZoom, 0);
}
updateIdSendScale(index-1, leftScale, 0);
} else if(root.hasInternalSeparator && root.latteApplet.internalSeparatorPos === root.tasksCount-1) {
updateIdSendScale(index-2, leftScale, 0);
updateIdSendScale(index+1, rightScale, 0);
updateIdSendScale(index+2, 1, 0);

@ -220,7 +220,7 @@ MouseArea{
width: root.vertical ? root.iconSize : 1
height: !root.vertical ? root.iconSize : 1
property int localThickMargin: root.thickMarginBase + 4
property int localThickMargin: root.statesLineSize + root.thickMarginBase + 4
Rectangle {
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
@ -236,6 +236,25 @@ MouseArea{
}
}
///Shadow in tasks
Loader{
id: separatorShadow
anchors.fill: separatorItem
active: root.enableShadows && isSeparator
sourceComponent: DropShadow{
anchors.fill: parent
color: "#ff080808"
samples: 2 * radius
source: separatorItem
radius: shadowSize
verticalOffset: 2
opacity: 0.5
property int shadowSize : Math.ceil(root.iconSize / 10)
}
}
Flow{
id: taskFlow
width: parent.width
@ -249,7 +268,7 @@ MouseArea{
width: root.vertical ? wrapper.width : nHiddenSize
height: root.vertical ? nHiddenSize : wrapper.height
visible: (index === 0) || (root.hasInternalSeparator && root.internalSeparatorPos === index-1)
visible: (index === 0) || (separatorSpace > 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) ?

Loading…
Cancel
Save