1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-02-13 21:57:40 +03:00

Tasks:update to location and alignment

--update implementation to use "root.location"
instead of root.position
--update implementation to use "root.alignment"
instead of root.userPanelPosition
This commit is contained in:
Michail Vourlakos 2020-04-16 13:00:12 +03:00
parent 6fffd19826
commit da648b5b4e
15 changed files with 142 additions and 170 deletions

View File

@ -134,26 +134,3 @@ function insertIndexAt(above, x, y) {
return stripe-1;
}
}
function taskPrefix(prefix) {
var effectivePrefix;
switch (plasmoid.location) {
case PlasmaCore.Types.LeftEdge:
effectivePrefix = "west-" + prefix;
break;
case PlasmaCore.Types.TopEdge:
effectivePrefix = "north-" + prefix;
break;
case PlasmaCore.Types.RightEdge:
effectivePrefix = "east-" + prefix;
break;
default:
effectivePrefix = "south-" + prefix;
}
if (!frame.hasElementPrefix(effectivePrefix)) {
return prefix;
}
return effectivePrefix;
}

View File

@ -45,11 +45,11 @@ PlasmaComponents.ContextMenu {
readonly property var containmentActions: latteView ? latteView.containmentActions() : []
placement: {
if (plasmoid.location === PlasmaCore.Types.LeftEdge) {
if (root.location === PlasmaCore.Types.LeftEdge) {
return PlasmaCore.Types.RightPosedTopAlignedPopup;
} else if (plasmoid.location === PlasmaCore.Types.TopEdge) {
} else if (root.location === PlasmaCore.Types.TopEdge) {
return PlasmaCore.Types.BottomPosedLeftAlignedPopup;
} else if (plasmoid.location === PlasmaCore.Types.RightEdge) {
} else if (root.location === PlasmaCore.Types.RightEdge) {
return PlasmaCore.Types.LeftPosedTopAlignedPopup;
} else {
return PlasmaCore.Types.TopPosedLeftAlignedPopup;

View File

@ -89,16 +89,14 @@ Item {
property int noTasksInAnimation: 0
property int themePanelSize: plasmoid.configuration.panelSize
property int position : {
if (plasmoid.location === PlasmaCore.Types.LeftEdge) {
return PlasmaCore.Types.LeftPositioned;
} else if (plasmoid.location === PlasmaCore.Types.RightEdge) {
return PlasmaCore.Types.RightPositioned;
} else if (plasmoid.location === PlasmaCore.Types.TopEdge) {
return PlasmaCore.Types.TopPositioned;
property int location : {
if (plasmoid.location === PlasmaCore.Types.LeftEdge
|| plasmoid.location === PlasmaCore.Types.RightEdge
|| plasmoid.location === PlasmaCore.Types.TopEdge) {
return plasmoid.location;
}
return PlasmaCore.Types.BottomPositioned;
return PlasmaCore.Types.BottomEdge;
}
property int tasksStarting: 0
@ -218,7 +216,7 @@ Item {
property int tasksHeight: mouseHandler.height
property int tasksWidth: mouseHandler.width
//updated from Binding
property int userPanelPosition
property int alignment
readonly property real currentPanelOpacity: latteView ? latteView.currentPanelTransparency / 100 : 1
@ -394,7 +392,7 @@ Item {
Binding {
target: root
property: "userPanelPosition"
property: "alignment"
value: {
if (latteView) {
if (latteView.panelUserSetAlignment === -1) {
@ -547,7 +545,7 @@ Item {
type: PlasmaCore.Dialog.Tooltip
flags: Qt.WindowStaysOnTopHint | Qt.WindowDoesNotAcceptFocus | Qt.ToolTip
location: plasmoid.location
location: root.location
mainItem: toolTipDelegate
visible: false
@ -813,7 +811,7 @@ Item {
type: PlasmaCore.Dialog.PopupMenu
flags: Qt.WindowStaysOnTopHint
hideOnWindowDeactivate: true
location: plasmoid.location
location: root.location
}
@ -1043,8 +1041,8 @@ Item {
width: root.vertical ? 1 : 2 * root.iconSize
height: root.vertical ? 2 * root.iconSize : 1
color: "red"
x: (root.position === PlasmaCore.Types.LeftPositioned) ? neededSpace : parent.width - neededSpace
y: (root.position === PlasmaCore.Types.TopPositioned) ? neededSpace : parent.height - neededSpace
x: (root.location === PlasmaCore.Types.LeftEdge) ? neededSpace : parent.width - neededSpace
y: (root.location === PlasmaCore.Types.TopEdge) ? neededSpace : parent.height - neededSpace
visible: plasmoid.configuration.zoomHelper
@ -1053,10 +1051,10 @@ Item {
Item{
id:barLine
anchors.bottom: (root.position === PlasmaCore.Types.BottomPositioned) ? parent.bottom : undefined
anchors.top: (root.position === PlasmaCore.Types.TopPositioned) ? parent.top : undefined
anchors.left: (root.position === PlasmaCore.Types.LeftPositioned) ? parent.left : undefined
anchors.right: (root.position === PlasmaCore.Types.RightPositioned) ? parent.right : undefined
anchors.bottom: (root.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined
anchors.top: (root.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined
anchors.left: (root.location === PlasmaCore.Types.LeftEdge) ? parent.left : undefined
anchors.right: (root.location === PlasmaCore.Types.RightEdge) ? parent.right : undefined
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
@ -1094,13 +1092,13 @@ Item {
Item{
id:belower
width: (root.position === PlasmaCore.Types.LeftPositioned) ? shadowsSvgItem.margins.left : shadowsSvgItem.margins.right
height: (root.position === PlasmaCore.Types.BottomPositioned)? shadowsSvgItem.margins.bottom : shadowsSvgItem.margins.top
width: (root.location === PlasmaCore.Types.LeftEdge) ? shadowsSvgItem.margins.left : shadowsSvgItem.margins.right
height: (root.location === PlasmaCore.Types.BottomEdge)? shadowsSvgItem.margins.bottom : shadowsSvgItem.margins.top
anchors.top: (root.position === PlasmaCore.Types.BottomPositioned) ? parent.bottom : undefined
anchors.bottom: (root.position === PlasmaCore.Types.TopPositioned) ? parent.top : undefined
anchors.right: (root.position === PlasmaCore.Types.LeftPositioned) ? parent.left : undefined
anchors.left: (root.position === PlasmaCore.Types.RightPositioned) ? parent.right : undefined
anchors.top: (root.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined
anchors.bottom: (root.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined
anchors.right: (root.location === PlasmaCore.Types.LeftEdge) ? parent.left : undefined
anchors.left: (root.location === PlasmaCore.Types.RightEdge) ? parent.right : undefined
}
@ -1108,10 +1106,10 @@ Item {
PlasmaCore.FrameSvgItem{
id: shadowsSvgItem
anchors.bottom: (root.position === PlasmaCore.Types.BottomPositioned) ? belower.bottom : undefined
anchors.top: (root.position === PlasmaCore.Types.TopPositioned) ? belower.top : undefined
anchors.left: (root.position === PlasmaCore.Types.LeftPositioned) ? belower.left : undefined
anchors.right: (root.position === PlasmaCore.Types.RightPositioned) ? belower.right : undefined
anchors.bottom: (root.location === PlasmaCore.Types.BottomEdge) ? belower.bottom : undefined
anchors.top: (root.location === PlasmaCore.Types.TopEdge) ? belower.top : undefined
anchors.left: (root.location === PlasmaCore.Types.LeftEdge) ? belower.left : undefined
anchors.right: (root.location === PlasmaCore.Types.RightEdge) ? belower.right : undefined
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
@ -1125,8 +1123,8 @@ Item {
opacity: (plasmoid.configuration.showBarLine && plasmoid.configuration.useThemePanel && !root.forceHidePanel) ? 1 : 0
visible: (opacity == 0) ? false : true
property int panelSize: ((root.position === PlasmaCore.Types.BottomPositioned) ||
(root.position === PlasmaCore.Types.TopPositioned)) ?
property int panelSize: ((root.location === PlasmaCore.Types.BottomEdge) ||
(root.location === PlasmaCore.Types.TopEdge)) ?
plasmoid.configuration.panelSize + belower.height:
plasmoid.configuration.panelSize + belower.width
@ -1146,10 +1144,10 @@ Item {
TasksLayout.MouseHandler {
id: mouseHandler
anchors.bottom: (root.position === PlasmaCore.Types.BottomPositioned) ? scrollableList.bottom : undefined
anchors.top: (root.position === PlasmaCore.Types.TopPositioned) ? scrollableList.top : undefined
anchors.left: (root.position === PlasmaCore.Types.LeftPositioned) ? scrollableList.left : undefined
anchors.right: (root.position === PlasmaCore.Types.RightPositioned) ? scrollableList.right : undefined
anchors.bottom: (root.location === PlasmaCore.Types.BottomEdge) ? scrollableList.bottom : undefined
anchors.top: (root.location === PlasmaCore.Types.TopEdge) ? scrollableList.top : undefined
anchors.left: (root.location === PlasmaCore.Types.LeftEdge) ? scrollableList.left : undefined
anchors.right: (root.location === PlasmaCore.Types.RightEdge) ? scrollableList.right : undefined
anchors.horizontalCenter: !root.vertical ? scrollableList.horizontalCenter : undefined
anchors.verticalCenter: root.vertical ? scrollableList.verticalCenter : undefined
@ -1243,10 +1241,10 @@ Item {
ListView {
id:icList
anchors.bottom: (root.position === PlasmaCore.Types.BottomPositioned) ? parent.bottom : undefined
anchors.top: (root.position === PlasmaCore.Types.TopPositioned) ? parent.top : undefined
anchors.left: (root.position === PlasmaCore.Types.LeftPositioned) ? parent.left : undefined
anchors.right: (root.position === PlasmaCore.Types.RightPositioned) ? parent.right : undefined
anchors.bottom: (root.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined
anchors.top: (root.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined
anchors.left: (root.location === PlasmaCore.Types.LeftEdge) ? parent.left : undefined
anchors.right: (root.location === PlasmaCore.Types.RightEdge) ? parent.right : undefined
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
@ -1920,14 +1918,13 @@ Item {
}
//BEGIN states
//user set Panel Positions
// Alignments
// 0-Center, 1-Left, 2-Right, 3-Top, 4-Bottom
states: [
///Bottom Edge
State {
name: "bottomCenter"
when: ((plasmoid.location===PlasmaCore.Types.BottomEdge || plasmoid.location===PlasmaCore.Types.Floating)
&& root.userPanelPosition===Latte.Types.Center)
when: (root.location===PlasmaCore.Types.BottomEdge && root.alignment===Latte.Types.Center)
AnchorChanges {
target: barLine
@ -1940,8 +1937,7 @@ Item {
},
State {
name: "bottomLeft"
when: ((plasmoid.location===PlasmaCore.Types.BottomEdge || plasmoid.location===PlasmaCore.Types.Floating)
&& root.userPanelPosition===Latte.Types.Left)
when: (root.location===PlasmaCore.Types.BottomEdge && root.alignment===Latte.Types.Left)
AnchorChanges {
target: barLine
@ -1954,8 +1950,7 @@ Item {
},
State {
name: "bottomRight"
when: ((plasmoid.location===PlasmaCore.Types.BottomEdge || plasmoid.location===PlasmaCore.Types.Floating)
&& root.userPanelPosition===Latte.Types.Right)
when: (root.location===PlasmaCore.Types.BottomEdge && root.alignment===Latte.Types.Right)
AnchorChanges {
target: barLine
@ -1969,7 +1964,7 @@ Item {
///Top Edge
State {
name: "topCenter"
when: (plasmoid.location===PlasmaCore.Types.TopEdge && root.userPanelPosition===Latte.Types.Center)
when: (root.location===PlasmaCore.Types.TopEdge && root.alignment===Latte.Types.Center)
AnchorChanges {
target: barLine
@ -1982,7 +1977,7 @@ Item {
},
State {
name: "topLeft"
when: (plasmoid.location===PlasmaCore.Types.TopEdge && root.userPanelPosition===Latte.Types.Left)
when: (root.location===PlasmaCore.Types.TopEdge && root.alignment===Latte.Types.Left)
AnchorChanges {
target: barLine
@ -1995,7 +1990,7 @@ Item {
},
State {
name: "topRight"
when: (plasmoid.location===PlasmaCore.Types.TopEdge && root.userPanelPosition===Latte.Types.Right)
when: (root.location===PlasmaCore.Types.TopEdge && root.alignment===Latte.Types.Right)
AnchorChanges {
target: barLine
@ -2009,7 +2004,7 @@ Item {
////Left Edge
State {
name: "leftCenter"
when: (plasmoid.location===PlasmaCore.Types.LeftEdge && root.userPanelPosition===Latte.Types.Center)
when: (root.location===PlasmaCore.Types.LeftEdge && root.alignment===Latte.Types.Center)
AnchorChanges {
target: barLine
@ -2022,7 +2017,7 @@ Item {
},
State {
name: "leftTop"
when: (plasmoid.location===PlasmaCore.Types.LeftEdge && root.userPanelPosition===Latte.Types.Top)
when: (root.location===PlasmaCore.Types.LeftEdge && root.alignment===Latte.Types.Top)
AnchorChanges {
target: barLine
@ -2035,7 +2030,7 @@ Item {
},
State {
name: "leftBottom"
when: (plasmoid.location===PlasmaCore.Types.LeftEdge && root.userPanelPosition===Latte.Types.Bottom)
when: (root.location===PlasmaCore.Types.LeftEdge && root.alignment===Latte.Types.Bottom)
AnchorChanges {
target: barLine
@ -2049,7 +2044,7 @@ Item {
///Right Edge
State {
name: "rightCenter"
when: (plasmoid.location===PlasmaCore.Types.RightEdge && root.userPanelPosition===Latte.Types.Center)
when: (root.location===PlasmaCore.Types.RightEdge && root.alignment===Latte.Types.Center)
AnchorChanges {
target: barLine
@ -2062,7 +2057,7 @@ Item {
},
State {
name: "rightTop"
when: (plasmoid.location===PlasmaCore.Types.RightEdge && root.userPanelPosition===Latte.Types.Top)
when: (root.location===PlasmaCore.Types.RightEdge && root.alignment===Latte.Types.Top)
AnchorChanges {
target: barLine
@ -2075,7 +2070,7 @@ Item {
},
State {
name: "rightBottom"
when: (plasmoid.location===PlasmaCore.Types.RightEdge && root.userPanelPosition===Latte.Types.Bottom)
when: (root.location===PlasmaCore.Types.RightEdge && root.alignment===Latte.Types.Bottom)
AnchorChanges {
target: barLine

View File

@ -35,7 +35,7 @@ Item {
states: [
State {
name: "default"
when: (root.position !== PlasmaCore.Types.RightPositioned)
when: (root.location !== PlasmaCore.Types.RightEdge)
AnchorChanges {
target: subRectangle
@ -44,7 +44,7 @@ Item {
},
State {
name: "right"
when: (root.position === PlasmaCore.Types.RightPositioned)
when: (root.location === PlasmaCore.Types.RightEdge)
AnchorChanges {
target: subRectangle

View File

@ -224,10 +224,10 @@ Item{
target:iconImageBuffer;
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined;
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined;
anchors.right: root.position === PlasmaCore.Types.RightPositioned ? parent.right : undefined;
anchors.left: root.position === PlasmaCore.Types.LeftPositioned ? parent.left : undefined;
anchors.top: root.position === PlasmaCore.Types.TopPositioned ? parent.top : undefined;
anchors.bottom: root.position === PlasmaCore.Types.BottomPositioned ? parent.bottom : undefined;
anchors.right: root.location === PlasmaCore.Types.RightEdge ? parent.right : undefined;
anchors.left: root.location === PlasmaCore.Types.LeftEdge ? parent.left : undefined;
anchors.top: root.location === PlasmaCore.Types.TopEdge ? parent.top : undefined;
anchors.bottom: root.location === PlasmaCore.Types.BottomEdge ? parent.bottom : undefined;
}
},
@ -239,10 +239,10 @@ Item{
target:iconImageBuffer;
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined;
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined;
anchors.right: root.position === PlasmaCore.Types.LeftPositioned ? parent.right : undefined;
anchors.left: root.position === PlasmaCore.Types.RightPositioned ? parent.left : undefined;
anchors.top: root.position === PlasmaCore.Types.BottomPositioned ? parent.top : undefined;
anchors.bottom: root.position === PlasmaCore.Types.TopPositioned ? parent.bottom : undefined;
anchors.right: root.location === PlasmaCore.Types.LeftEdge ? parent.right : undefined;
anchors.left: root.location === PlasmaCore.Types.RightEdge ? parent.left : undefined;
anchors.top: root.location === PlasmaCore.Types.BottomEdge ? parent.top : undefined;
anchors.bottom: root.location === PlasmaCore.Types.TopEdge ? parent.bottom : undefined;
}
}
]
@ -347,7 +347,7 @@ Item{
states: [
State {
name: "default"
when: (plasmoid.location !== PlasmaCore.Types.RightEdge)
when: (root.location !== PlasmaCore.Types.RightEdge)
AnchorChanges {
target: maskRect
@ -360,7 +360,7 @@ Item{
},
State {
name: "right"
when: (plasmoid.location === PlasmaCore.Types.RightEdge)
when: (root.location === PlasmaCore.Types.RightEdge)
AnchorChanges {
target: maskRect
@ -390,7 +390,7 @@ Item{
states: [
State {
name: "default"
when: (plasmoid.location !== PlasmaCore.Types.RightEdge)
when: (root.location !== PlasmaCore.Types.RightEdge)
AnchorChanges {
target: maskRect2
@ -403,7 +403,7 @@ Item{
},
State {
name: "right"
when: (plasmoid.location === PlasmaCore.Types.RightEdge)
when: (root.location === PlasmaCore.Types.RightEdge)
AnchorChanges {
target: maskRect2

View File

@ -38,7 +38,7 @@ Item {
states: [
State {
name: "default"
when: (root.position !== PlasmaCore.Types.RightPositioned)
when: (root.location !== PlasmaCore.Types.RightEdge)
AnchorChanges {
target: subRectangle
@ -47,7 +47,7 @@ Item {
},
State {
name: "right"
when: (root.position === PlasmaCore.Types.RightPositioned)
when: (root.location === PlasmaCore.Types.RightEdge)
AnchorChanges {
target: subRectangle

View File

@ -38,10 +38,10 @@ MouseArea{
visible: false //true//(isStartup && root.durationTime !== 0) ? false : true
anchors.bottom: (root.position === PlasmaCore.Types.BottomPositioned) ? parent.bottom : undefined
anchors.top: (root.position === PlasmaCore.Types.TopPositioned) ? parent.top : undefined
anchors.left: (root.position === PlasmaCore.Types.LeftPositioned) ? parent.left : undefined
anchors.right: (root.position === PlasmaCore.Types.RightPositioned) ? parent.right : undefined
anchors.bottom: (root.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined
anchors.top: (root.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined
anchors.left: (root.location === PlasmaCore.Types.LeftEdge) ? parent.left : undefined
anchors.right: (root.location === PlasmaCore.Types.RightEdge) ? parent.right : undefined
objectName: "TaskItem"
@ -327,18 +327,18 @@ MouseArea{
Item{
id:separatorItem
anchors.bottom: (root.position === PlasmaCore.Types.BottomPositioned) ? parent.bottom : undefined
anchors.top: (root.position === PlasmaCore.Types.TopPositioned) ? parent.top : undefined
anchors.left: (root.position === PlasmaCore.Types.LeftPositioned) ? parent.left : undefined
anchors.right: (root.position === PlasmaCore.Types.RightPositioned) ? parent.right : undefined
anchors.bottom: (root.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined
anchors.top: (root.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined
anchors.left: (root.location === PlasmaCore.Types.LeftEdge) ? parent.left : undefined
anchors.right: (root.location === PlasmaCore.Types.RightEdge) ? parent.right : undefined
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
anchors.bottomMargin: (root.position === PlasmaCore.Types.BottomPositioned) ? root.screenEdgeMargin + root.thickMargin : 0
anchors.topMargin: (root.position === PlasmaCore.Types.TopPositioned) ? root.screenEdgeMargin + root.thickMargin : 0
anchors.leftMargin: (root.position === PlasmaCore.Types.LeftPositioned) ? root.screenEdgeMargin + root.thickMargin : 0
anchors.rightMargin: (root.position === PlasmaCore.Types.RightPositioned) ? root.screenEdgeMargin + root.thickMargin : 0
anchors.bottomMargin: (root.location === PlasmaCore.Types.BottomEdge) ? root.screenEdgeMargin + root.thickMargin : 0
anchors.topMargin: (root.location === PlasmaCore.Types.TopEdge) ? root.screenEdgeMargin + root.thickMargin : 0
anchors.leftMargin: (root.location === PlasmaCore.Types.LeftEdge) ? root.screenEdgeMargin + root.thickMargin : 0
anchors.rightMargin: (root.location === PlasmaCore.Types.RightEdge) ? root.screenEdgeMargin + root.thickMargin : 0
opacity: (separatorShadow.active) || forceHiddenState ? 0 : 0.4
visible: taskItem.isSeparator
@ -1340,16 +1340,16 @@ MouseArea{
globalChoords.y = adjY;
if (latteView && latteView.dockIsHidden) {
if (root.position === PlasmaCore.Types.BottomPositioned) {
if (root.location === PlasmaCore.Types.BottomEdge) {
globalChoords.y = root.screenGeometry.y+root.screenGeometry.height-1;
globalChoords.height = 1;
} else if (root.position === PlasmaCore.Types.TopPositioned) {
} else if (root.location === PlasmaCore.Types.TopEdge) {
globalChoords.y = root.screenGeometry.y+1;
globalChoords.height = 1;
} else if (root.position === PlasmaCore.Types.LeftPositioned) {
} else if (root.location === PlasmaCore.Types.LeftEdge) {
globalChoords.x = root.screenGeometry.x+1;
globalChoords.width = 1;
} else if (root.position === PlasmaCore.Types.RightPositioned) {
} else if (root.location === PlasmaCore.Types.RightEdge) {
globalChoords.x = root.screenGeometry.x+root.screenGeometry.width - 1;
globalChoords.width = 1;
}

View File

@ -36,7 +36,7 @@ Item{
states:[
State{
name: "bottom"
when: root.position === PlasmaCore.Types.BottomPositioned
when: root.location === PlasmaCore.Types.BottomEdge
AnchorChanges{
target: visual;
@ -47,7 +47,7 @@ Item{
},
State{
name: "top"
when: root.position === PlasmaCore.Types.TopPositioned
when: root.location === PlasmaCore.Types.TopEdge
AnchorChanges{
target:visual;
@ -58,7 +58,7 @@ Item{
},
State{
name: "left"
when: root.position === PlasmaCore.Types.LeftPositioned
when: root.location === PlasmaCore.Types.LeftEdge
AnchorChanges{
target: visual;
@ -69,7 +69,7 @@ Item{
},
State{
name: "right"
when: root.position === PlasmaCore.Types.RightPositioned
when: root.location === PlasmaCore.Types.RightEdge
AnchorChanges{
target: visual;

View File

@ -135,18 +135,18 @@ Item{
IconItem{
id: taskIconItem
anchors.bottom: (root.position === PlasmaCore.Types.BottomPositioned) ? parent.bottom : undefined
anchors.top: (root.position === PlasmaCore.Types.TopPositioned) ? parent.top : undefined
anchors.left: (root.position === PlasmaCore.Types.LeftPositioned) ? parent.left : undefined
anchors.right: (root.position === PlasmaCore.Types.RightPositioned) ? parent.right : undefined
anchors.bottom: (root.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined
anchors.top: (root.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined
anchors.left: (root.location === PlasmaCore.Types.LeftEdge) ? parent.left : undefined
anchors.right: (root.location === PlasmaCore.Types.RightEdge) ? parent.right : undefined
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
anchors.bottomMargin: (root.position === PlasmaCore.Types.BottomPositioned) ? root.screenEdgeMargin : 0
anchors.topMargin: (root.position === PlasmaCore.Types.TopPositioned) ? root.screenEdgeMargin : 0
anchors.leftMargin: (root.position === PlasmaCore.Types.LeftPositioned) ? root.screenEdgeMargin : 0
anchors.rightMargin: (root.position === PlasmaCore.Types.RightPositioned) ? root.screenEdgeMargin : 0
anchors.bottomMargin: (root.location === PlasmaCore.Types.BottomEdge) ? root.screenEdgeMargin : 0
anchors.topMargin: (root.location === PlasmaCore.Types.TopEdge) ? root.screenEdgeMargin : 0
anchors.leftMargin: (root.location === PlasmaCore.Types.LeftEdge) ? root.screenEdgeMargin : 0
anchors.rightMargin: (root.location === PlasmaCore.Types.RightEdge) ? root.screenEdgeMargin : 0
anchors.horizontalCenterOffset: taskItem.iconOffsetX
anchors.verticalCenterOffset: taskItem.iconOffsetY

View File

@ -67,17 +67,17 @@ Item{
Latte.IconItem{
id: tempRemoveIcon
anchors.rightMargin: root.position === PlasmaCore.Types.LeftPositioned ? root.thickMargin : 0
anchors.leftMargin: root.position === PlasmaCore.Types.RightPositioned ? root.thickMargin : 0
anchors.topMargin: root.position === PlasmaCore.Types.BottomPositioned ? root.thickMargin : 0
anchors.bottomMargin: root.position === PlasmaCore.Types.TopPositioned ? root.thickMargin : 0
anchors.rightMargin: root.location === PlasmaCore.Types.LeftEdge ? root.thickMargin : 0
anchors.leftMargin: root.location === PlasmaCore.Types.RightEdge ? root.thickMargin : 0
anchors.topMargin: root.location === PlasmaCore.Types.BottomEdge ? root.thickMargin : 0
anchors.bottomMargin: root.location === PlasmaCore.Types.TopEdge ? root.thickMargin : 0
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined;
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined;
anchors.right: root.position === PlasmaCore.Types.LeftPositioned ? parent.right : undefined;
anchors.left: root.position === PlasmaCore.Types.RightPositioned ? parent.left : undefined;
anchors.top: root.position === PlasmaCore.Types.BottomPositioned ? parent.top : undefined;
anchors.bottom: root.position === PlasmaCore.Types.TopPositioned ? parent.bottom : undefined;
anchors.right: root.location === PlasmaCore.Types.LeftEdge ? parent.right : undefined;
anchors.left: root.location === PlasmaCore.Types.RightEdge ? parent.left : undefined;
anchors.top: root.location === PlasmaCore.Types.BottomEdge ? parent.top : undefined;
anchors.bottom: root.location === PlasmaCore.Types.TopEdge ? parent.bottom : undefined;
width: iconImageBuffer.width
height: width
@ -147,8 +147,8 @@ Item{
else
tempPoint = x;
if( (root.position === PlasmaCore.Types.BottomPositioned) ||
(root.position === PlasmaCore.Types.RightPositioned) ){
if( (root.location === PlasmaCore.Types.BottomEdge) ||
(root.location === PlasmaCore.Types.RightEdge) ){
componentRemoveAnimation.toPoint = tempPoint + root.iconSize;
}
else{

View File

@ -26,10 +26,10 @@ import org.kde.latte 0.2 as Latte
Loader {
id: indicatorLoader
anchors.bottom: (root.position === PlasmaCore.Types.BottomPositioned) ? parent.bottom : undefined
anchors.top: (root.position === PlasmaCore.Types.TopPositioned) ? parent.top : undefined
anchors.left: (root.position === PlasmaCore.Types.LeftPositioned) ? parent.left : undefined
anchors.right: (root.position === PlasmaCore.Types.RightPositioned) ? parent.right : undefined
anchors.bottom: (root.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined
anchors.top: (root.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined
anchors.left: (root.location === PlasmaCore.Types.LeftEdge) ? parent.left : undefined
anchors.right: (root.location === PlasmaCore.Types.RightEdge) ? parent.right : undefined
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined

View File

@ -62,7 +62,7 @@ Item {
states: [
State {
name: "bottom"
when: plasmoid.location === PlasmaCore.Types.BottomEdge
when: root.location === PlasmaCore.Types.BottomEdge
AnchorChanges {
target: firstGradient
@ -87,7 +87,7 @@ Item {
},
State {
name: "top"
when: plasmoid.location === PlasmaCore.Types.TopEdge
when: root.location === PlasmaCore.Types.TopEdge
AnchorChanges {
target: firstGradient
@ -112,7 +112,7 @@ Item {
},
State {
name: "left"
when: plasmoid.location === PlasmaCore.Types.LeftEdge
when: root.location === PlasmaCore.Types.LeftEdge
AnchorChanges {
target: firstGradient
@ -137,7 +137,7 @@ Item {
},
State {
name: "right"
when: plasmoid.location === PlasmaCore.Types.RightEdge
when: root.location === PlasmaCore.Types.RightEdge
AnchorChanges {
target: firstGradient

View File

@ -70,7 +70,7 @@ Item {
states: [
State {
name: "bottom"
when: plasmoid.location === PlasmaCore.Types.BottomEdge
when: root.location === PlasmaCore.Types.BottomEdge
AnchorChanges {
target: firstGradient
@ -90,7 +90,7 @@ Item {
},
State {
name: "top"
when: plasmoid.location === PlasmaCore.Types.TopEdge
when: root.location === PlasmaCore.Types.TopEdge
AnchorChanges {
target: firstGradient
@ -110,7 +110,7 @@ Item {
},
State {
name: "left"
when: plasmoid.location === PlasmaCore.Types.LeftEdge
when: root.location === PlasmaCore.Types.LeftEdge
AnchorChanges {
target: firstGradient
@ -130,7 +130,7 @@ Item {
},
State {
name: "right"
when: plasmoid.location === PlasmaCore.Types.RightEdge
when: root.location === PlasmaCore.Types.RightEdge
AnchorChanges {
target: firstGradient

View File

@ -29,11 +29,11 @@ Rectangle {
if (plasmoid.location===PlasmaCore.Types.Floating) {
//! Center position Tasks when are located in the Desktop
return root.width < icList.width ? (root.width/2) : icList.width/2;
} else if (root.userPanelPosition === Latte.Types.Center) {
} else if (root.alignment === Latte.Types.Center) {
return icList.width / 2;
} else if (root.userPanelPosition === Latte.Types.Left){
} else if (root.alignment === Latte.Types.Left){
return 0;
} else if (root.userPanelPosition === Latte.Types.Right){
} else if (root.alignment === Latte.Types.Right){
return icList.width;
}
} else {
@ -45,11 +45,11 @@ Rectangle {
if (!root.vertical) {
return 0;
} else {
if (root.userPanelPosition === Latte.Types.Center) {
if (root.alignment === Latte.Types.Center) {
return icList.height / 2;
} else if (root.userPanelPosition === Latte.Types.Top){
} else if (root.alignment === Latte.Types.Top){
return 0;
} else if (root.userPanelPosition === Latte.Types.Bottom){
} else if (root.alignment === Latte.Types.Bottom){
return icList.height;
}
}

View File

@ -32,7 +32,7 @@ Flickable{
property int offset: 0
readonly property bool animationsFinished: !horizontalAnimation.running && !verticalAnimation.running
readonly property bool centered: userPanelPosition === Latte.Types.Center
readonly property bool centered: root.alignment === Latte.Types.Center
readonly property bool reversed: Qt.application.layoutDirection === Qt.RightToLeft
readonly property bool contentsExceed: {
@ -62,42 +62,42 @@ Flickable{
readonly property int autoScrollTriggerLength: root.iconSize + root.lengthMargins/2
readonly property int alignment: {
if (plasmoid.location === PlasmaCore.Types.LeftEdge) {
if (root.location === PlasmaCore.Types.LeftEdge) {
if (centered) return Latte.Types.LeftEdgeCenterAlign;
if (userPanelPosition === Latte.Types.Top) return Latte.Types.LeftEdgeTopAlign;
if (userPanelPosition === Latte.Types.Bottom) return Latte.Types.LeftEdgeBottomAlign;
if (root.alignment === Latte.Types.Top) return Latte.Types.LeftEdgeTopAlign;
if (root.alignment === Latte.Types.Bottom) return Latte.Types.LeftEdgeBottomAlign;
}
if (plasmoid.location === PlasmaCore.Types.RightEdge) {
if (root.location === PlasmaCore.Types.RightEdge) {
if (centered) return Latte.Types.RightEdgeCenterAlign;
if (userPanelPosition === Latte.Types.Top) return Latte.Types.RightEdgeTopAlign;
if (userPanelPosition === Latte.Types.Bottom) return Latte.Types.RightEdgeBottomAlign;
if (root.alignment === Latte.Types.Top) return Latte.Types.RightEdgeTopAlign;
if (root.alignment === Latte.Types.Bottom) return Latte.Types.RightEdgeBottomAlign;
}
if (plasmoid.location === PlasmaCore.Types.BottomEdge) {
if (root.location === PlasmaCore.Types.BottomEdge) {
if (centered) return Latte.Types.BottomEdgeCenterAlign;
if ((userPanelPosition === Latte.Types.Left && !reversed)
|| (userPanelPosition === Latte.Types.Right && reversed)) {
if ((root.alignment === Latte.Types.Left && !reversed)
|| (root.alignment === Latte.Types.Right && reversed)) {
return Latte.Types.BottomEdgeLeftAlign;
}
if ((userPanelPosition === Latte.Types.Right && !reversed)
|| (userPanelPosition === Latte.Types.Left && reversed)) {
if ((root.alignment === Latte.Types.Right && !reversed)
|| (root.alignment === Latte.Types.Left && reversed)) {
return Latte.Types.BottomEdgeRightAlign;
}
}
if (plasmoid.location === PlasmaCore.Types.TopEdge) {
if (root.location === PlasmaCore.Types.TopEdge) {
if (centered) return Latte.Types.TopEdgeCenterAlign;
if ((userPanelPosition === Latte.Types.Left && !reversed)
|| (userPanelPosition === Latte.Types.Right && reversed)) {
if ((root.alignment === Latte.Types.Left && !reversed)
|| (root.alignment === Latte.Types.Right && reversed)) {
return Latte.Types.TopEdgeLeftAlign;
}
if ((userPanelPosition === Latte.Types.Right && !reversed)
|| (userPanelPosition === Latte.Types.Left && reversed)) {
if ((root.alignment === Latte.Types.Right && !reversed)
|| (root.alignment === Latte.Types.Left && reversed)) {
return Latte.Types.TopEdgeRightAlign;
}
}
@ -223,7 +223,7 @@ Flickable{
}
//////////////////////////BEGIN states
//user set Panel Positions
// Alignment
// 0-Center, 1-Left, 2-Right, 3-Top, 4-Bottom
states: [
///Left Edge