1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-26 23:21:37 +03:00

move alignment into scrollingarea

This commit is contained in:
Michail Vourlakos 2019-04-21 11:42:38 +03:00
parent fcb04c2144
commit 88af46f5bf
2 changed files with 45 additions and 45 deletions

View File

@ -1223,50 +1223,6 @@ Item {
//onCurrentPosChanged: console.log("CP :: "+ currentPos + " icW:"+icList.width + " rw: "+root.width + " w:" +width);
alignment: {
if (plasmoid.location === PlasmaCore.Types.LeftEdge) {
if (centered) return Latte.Types.LeftEdgeCenterAlign;
if (root.panelAlignment === Latte.Types.Top) return Latte.Types.LeftEdgeTopAlign;
if (root.panelAlignment === Latte.Types.Bottom) return Latte.Types.LeftEdgeBottomAlign;
}
if (plasmoid.location === PlasmaCore.Types.RightEdge) {
if (centered) return Latte.Types.RightEdgeCenterAlign;
if (root.panelAlignment === Latte.Types.Top) return Latte.Types.RightEdgeTopAlign;
if (root.panelAlignment === Latte.Types.Bottom) return Latte.Types.RightEdgeBottomAlign;
}
if (plasmoid.location === PlasmaCore.Types.BottomEdge) {
if (centered) return Latte.Types.BottomEdgeCenterAlign;
if ((root.panelAlignment === Latte.Types.Left && !reversed)
|| (root.panelAlignment === Latte.Types.Right && reversed)) {
return Latte.Types.BottomEdgeLeftAlign;
}
if ((root.panelAlignment === Latte.Types.Right && !reversed)
|| (root.panelAlignment === Latte.Types.Left && reversed)) {
return Latte.Types.BottomEdgeRightAlign;
}
}
if (plasmoid.location === PlasmaCore.Types.TopEdge) {
if (centered) return Latte.Types.TopEdgeCenterAlign;
if ((root.panelAlignment === Latte.Types.Left && !reversed)
|| (root.panelAlignment === Latte.Types.Right && reversed)) {
return Latte.Types.TopEdgeLeftAlign;
}
if ((root.panelAlignment === Latte.Types.Right && !reversed)
|| (root.panelAlignment === Latte.Types.Left && reversed)) {
return Latte.Types.TopEdgeRightAlign;
}
}
return Latte.Types.BottomEdgeCenterAlign;
}
layer.enabled: contentsExceed && root.scrollingEnabled
layer.effect: OpacityMask {
maskSource: TasksLayout.ScrollOpacityMask{

View File

@ -29,7 +29,6 @@ Flickable{
flickableDirection: plasmoid.formFactor === PlasmaCore.Types.Horizontal ? Flickable.HorizontalFlick : Flickable.VerticalFlick
interactive: false
property int alignment: Latte.Types.BottomEdgeCenterAlign
property int offset: 0
readonly property bool contentsExceed: !root.vertical ? Math.floor(contentWidth) > width : Math.floor(contentHeight) > height
@ -51,6 +50,51 @@ Flickable{
readonly property int currentPos: !root.vertical ? contentX : contentY
readonly property int alignment: {
if (plasmoid.location === PlasmaCore.Types.LeftEdge) {
if (centered) return Latte.Types.LeftEdgeCenterAlign;
if (root.panelAlignment === Latte.Types.Top) return Latte.Types.LeftEdgeTopAlign;
if (root.panelAlignment === Latte.Types.Bottom) return Latte.Types.LeftEdgeBottomAlign;
}
if (plasmoid.location === PlasmaCore.Types.RightEdge) {
if (centered) return Latte.Types.RightEdgeCenterAlign;
if (root.panelAlignment === Latte.Types.Top) return Latte.Types.RightEdgeTopAlign;
if (root.panelAlignment === Latte.Types.Bottom) return Latte.Types.RightEdgeBottomAlign;
}
if (plasmoid.location === PlasmaCore.Types.BottomEdge) {
if (centered) return Latte.Types.BottomEdgeCenterAlign;
if ((root.panelAlignment === Latte.Types.Left && !reversed)
|| (root.panelAlignment === Latte.Types.Right && reversed)) {
return Latte.Types.BottomEdgeLeftAlign;
}
if ((root.panelAlignment === Latte.Types.Right && !reversed)
|| (root.panelAlignment === Latte.Types.Left && reversed)) {
return Latte.Types.BottomEdgeRightAlign;
}
}
if (plasmoid.location === PlasmaCore.Types.TopEdge) {
if (centered) return Latte.Types.TopEdgeCenterAlign;
if ((root.panelAlignment === Latte.Types.Left && !reversed)
|| (root.panelAlignment === Latte.Types.Right && reversed)) {
return Latte.Types.TopEdgeLeftAlign;
}
if ((root.panelAlignment === Latte.Types.Right && !reversed)
|| (root.panelAlignment === Latte.Types.Left && reversed)) {
return Latte.Types.TopEdgeRightAlign;
}
}
return Latte.Types.BottomEdgeCenterAlign;
}
function increasePos() {
if (!root.vertical) {
contentX = Math.min(scrollLastPos, contentX + scrollStep);