plasmoid align perfectly its items

--this way we make the calculations correctly
and its contents are not moved 1px far from the
perferct offset value in order to look consistent
with the rest items of the dock
work/spdx
Michail Vourlakos 4 years ago
parent d46864e0ad
commit ba502fa595

@ -27,11 +27,13 @@ Rectangle {
x: {
if (!root.vertical) {
if (root.alignment === LatteCore.Types.Center) {
return icList.width / 2;
//! this way we get a perfectly centered offset value
return (icList.width-1) / 2;
} else if (root.alignment === LatteCore.Types.Left){
return 0;
} else if (root.alignment === LatteCore.Types.Right){
return icList.width;
//! this way we get a perfectly right aligned offset value
return (icList.width-1);
}
}
@ -41,11 +43,13 @@ Rectangle {
y: {
if (root.vertical) {
if (root.alignment === LatteCore.Types.Center) {
return icList.height / 2;
//! this way we get a perfectly centered offset value
return (icList.height-1) / 2;
} else if (root.alignment === LatteCore.Types.Top){
return 0;
} else if (root.alignment === LatteCore.Types.Bottom){
return icList.height;
//! this way we get a perfectly bottom aligned offset value
return (icList.height-1);
}
}

@ -29,7 +29,7 @@ Flickable{
flickableDirection: plasmoid.formFactor === PlasmaCore.Types.Horizontal ? Flickable.HorizontalFlick : Flickable.VerticalFlick
interactive: false
property int offset: 0
property real offset: 0
readonly property bool animationsFinished: !horizontalAnimation.running && !verticalAnimation.running
readonly property bool centered: root.alignment === LatteCore.Types.Center
@ -54,12 +54,12 @@ Flickable{
return 0;
}
readonly property int scrollFirstPos: 0
readonly property int scrollLastPos: contentsExtraSpace
readonly property int scrollStep: appletAbilities.metrics.totals.length * 3.5
readonly property int currentPos: !root.vertical ? contentX : contentY
readonly property real scrollFirstPos: 0
readonly property real scrollLastPos: contentsExtraSpace
readonly property real scrollStep: appletAbilities.metrics.totals.length * 3.5
readonly property real currentPos: !root.vertical ? contentX : contentY
readonly property int autoScrollTriggerLength: appletAbilities.metrics.iconSize + appletAbilities.metrics.totals.lengthEdge
readonly property real autoScrollTriggerLength: appletAbilities.metrics.iconSize + appletAbilities.metrics.totals.lengthEdge
readonly property int alignment: {
if (root.location === PlasmaCore.Types.LeftEdge) {

Loading…
Cancel
Save