mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
up arrow becomes down
This commit is contained in:
parent
f30008b3d9
commit
93d8e2c130
1 changed files with 37 additions and 4 deletions
|
|
@ -245,24 +245,57 @@ Item {
|
||||||
imagePath: "widgets/arrows"
|
imagePath: "widgets/arrows"
|
||||||
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
||||||
}
|
}
|
||||||
PlasmaCore.IconItem {
|
Item {
|
||||||
id: arrowUpIcon
|
id: arrowUpIcon
|
||||||
z: 9
|
z: 9
|
||||||
anchors {
|
anchors {
|
||||||
horizontalCenter: parent.horizontalCenter
|
horizontalCenter: parent.horizontalCenter
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
source: "arrow-up"
|
|
||||||
width: units.iconSizes.medium
|
width: units.iconSizes.medium
|
||||||
height: width
|
height: width
|
||||||
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
|
||||||
|
|
||||||
|
property real factor: Math.max(0, Math.min(1, mainFlickable.contentY / (mainFlickable.height/2)))
|
||||||
|
Rectangle {
|
||||||
|
anchors {
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
right: parent.horizontalCenter
|
||||||
|
left: parent.left
|
||||||
|
verticalCenterOffset: -arrowUpIcon.height/4 + (arrowUpIcon.height/4) * arrowUpIcon.factor
|
||||||
|
}
|
||||||
|
color: theme.backgroundColor
|
||||||
|
transformOrigin: Item.Right
|
||||||
|
rotation: -45 + 90 * parent.factor
|
||||||
|
antialiasing: true
|
||||||
|
height: 1
|
||||||
|
}
|
||||||
|
Rectangle {
|
||||||
|
anchors {
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.horizontalCenter
|
||||||
|
right: parent.right
|
||||||
|
verticalCenterOffset: -arrowUpIcon.height/4 + (arrowUpIcon.height/4) * arrowUpIcon.factor
|
||||||
|
}
|
||||||
|
color: theme.backgroundColor
|
||||||
|
transformOrigin: Item.Left
|
||||||
|
rotation: 45 - 90 * parent.factor
|
||||||
|
antialiasing: true
|
||||||
|
height: 1
|
||||||
|
}
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors {
|
anchors {
|
||||||
fill: parent
|
fill: parent
|
||||||
margins: -units.smallSpacing
|
margins: -units.smallSpacing
|
||||||
}
|
}
|
||||||
onClicked: mainFlickable.flick(0, -mainFlickable.height)
|
onClicked: {
|
||||||
|
if (mainFlickable.contentY >= mainFlickable.height/2) {
|
||||||
|
scrollAnim.to = 0;
|
||||||
|
} else {
|
||||||
|
scrollAnim.to = mainFlickable.height/2
|
||||||
|
}
|
||||||
|
scrollAnim.restart();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue