mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-27 22:33:08 +00:00
a simple scrollbar
This commit is contained in:
parent
c096ffb366
commit
4b77fe4647
1 changed files with 35 additions and 4 deletions
|
|
@ -291,15 +291,46 @@ Item {
|
||||||
height: width
|
height: width
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PlasmaComponents.ScrollBar {
|
|
||||||
flickableItem: applicationsView
|
Rectangle {
|
||||||
opacity: applicationsView.flicking ? 1 : 0
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
bottom: parent.bottom
|
||||||
|
horizontalCenter: scrollHandle.horizontalCenter
|
||||||
|
}
|
||||||
|
width: units.smallSpacing
|
||||||
|
color: PlasmaCore.ColorScope.textColor
|
||||||
|
opacity: scrollHandle.opacity / 2
|
||||||
|
}
|
||||||
|
Rectangle {
|
||||||
|
id: scrollHandle
|
||||||
|
color: PlasmaCore.ColorScope.textColor
|
||||||
|
width: units.gridUnit
|
||||||
|
height: width
|
||||||
|
radius: width
|
||||||
|
anchors.right: parent.right
|
||||||
|
y: applicationsView.height * applicationsView.visibleArea.yPosition
|
||||||
|
opacity: scrollbarMouse.pressed || applicationsView.flicking ? 0.8 : 0
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: units.shortDuration
|
duration: units.longDuration
|
||||||
easing.type: Easing.InOutQuad
|
easing.type: Easing.InOutQuad
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
MouseArea {
|
||||||
|
id: scrollbarMouse
|
||||||
|
anchors {
|
||||||
|
fill: parent
|
||||||
|
margins: -units.gridUnit
|
||||||
|
}
|
||||||
|
drag.target: parent
|
||||||
|
onPositionChanged: {
|
||||||
|
applicationsView.contentY = applicationsView.contentHeight * (parent.y / applicationsView.height) - applicationsView.headerItem.height
|
||||||
|
}
|
||||||
|
onReleased: {
|
||||||
|
applicationsView.returnToBounds()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue