Commit 2fc9d05c authored by Noah Davis's avatar Noah Davis 🌵
Browse files

[ScrollHandle] Use Templates instead of Controls, use Kirigami Units for duration

parent 9f9fc447
......@@ -3,25 +3,25 @@
*/
import QtQuick 2.15
import QtQuick.Controls 2.15 as Controls
import QtQuick.Templates 2.15 as T
import org.kde.kirigami 2.14 as Kirigami
Rectangle {
id: root
property alias control: root.parent
// ScrollIndicator does not have a policy property
property int policy: Controls.ScrollBar.AsNeeded
property int policy: T.ScrollBar.AsNeeded
// ScrollIndicator does not have a pressed property
property bool pressed: false
visible: control.size < 1 && root.policy !== Controls.ScrollBar.AlwaysOff
visible: control.size < 1 && root.policy !== T.ScrollBar.AlwaysOff
implicitWidth: Kirigami.Units.grooveHeight
implicitHeight: implicitWidth
radius: width / 2
opacity: root.policy === Controls.ScrollBar.AsNeeded ? 0 : 1
opacity: root.policy === T.ScrollBar.AsNeeded ? 0 : 1
Kirigami.Theme.inherit: false
Kirigami.Theme.colorSet: Kirigami.Theme.Button
......@@ -37,21 +37,19 @@ Rectangle {
states: State {
name: "active"
when: root.policy === Controls.ScrollBar.AlwaysOn || (control.active && control.size < 1.0)
when: root.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0)
PropertyChanges {
target: root
opacity: root.policy === Controls.ScrollBar.AsNeeded ? 0.75 : 1
opacity: root.policy === T.ScrollBar.AsNeeded ? 0.75 : 1
}
}
transitions: Transition {
from: "active"
SequentialAnimation {
PauseAnimation { duration: 450 }
PauseAnimation { duration: Kirigami.Units.veryLongDuration }
OpacityAnimator {
//target: control.contentItem
duration: Kirigami.Units.longDuration
//property: "opacity"
to: 0.0
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment