Warning, /plasma/qqc2-breeze-style/style/impl/ScrollHandle.qml is written in an unsupported language. File is not indexed.

0001 /* SPDX-FileCopyrightText: 2020 Noah Davis <noahadvs@gmail.com>
0002  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0003  */
0004 
0005 import QtQuick
0006 import QtQuick.Templates as T
0007 import org.kde.kirigami as Kirigami
0008 
0009 import "." as Impl
0010 
0011 Rectangle {
0012     id: root
0013     property T.Control control: root.parent
0014     // ScrollIndicator does not have a policy property
0015     property int policy: T.ScrollBar.AsNeeded
0016     // ScrollIndicator does not have a pressed property
0017     property bool pressed: false
0018 
0019     visible: control.size < 1 && root.policy !== T.ScrollBar.AlwaysOff
0020 
0021     implicitWidth: Impl.Units.grooveHeight
0022     implicitHeight: implicitWidth
0023 
0024     radius: width / 2
0025 
0026     opacity: root.policy === T.ScrollBar.AsNeeded ? 0 : 1
0027 
0028     Kirigami.Theme.inherit: false
0029     Kirigami.Theme.colorSet: Kirigami.Theme.Button
0030     color: root.pressed ? Kirigami.Theme.focusColor : Impl.Theme.separatorColor()
0031 
0032     Behavior on color {
0033         enabled: root.pressed
0034         ColorAnimation {
0035             duration: Kirigami.Units.shortDuration
0036             easing.type: Easing.OutCubic
0037         }
0038     }
0039 
0040     states: State {
0041         name: "active"
0042         when: root.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0)
0043         PropertyChanges {
0044             target: root
0045             opacity: root.policy === T.ScrollBar.AsNeeded ? 0.75 : 1
0046         }
0047     }
0048 
0049     transitions: Transition {
0050         from: "active"
0051         SequentialAnimation {
0052             PauseAnimation { duration: Kirigami.Units.veryLongDuration }
0053             OpacityAnimator {
0054                 duration: Kirigami.Units.longDuration
0055                 to: 0.0
0056             }
0057         }
0058     }
0059 }