diff options
| author | Nippy <nippy@rp1.hu> | 2026-05-08 19:50:49 +0200 |
|---|---|---|
| committer | Nippy <nippy@rp1.hu> | 2026-05-08 19:50:49 +0200 |
| commit | 3462bcc46ecf74f576ea4397f16492c16bd75b10 (patch) | |
| tree | c5ab7aef4498647e057bda8d49c11e5f9dda74c9 /raveos-hyprland-theme/theme-data/dms/Widgets/DankScrollbar.qml | |
| parent | 56616f693b4f263cbf0d47da43b67424efa6022d (diff) | |
| download | RaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.tar.gz RaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.zip | |
raveos update
Diffstat (limited to 'raveos-hyprland-theme/theme-data/dms/Widgets/DankScrollbar.qml')
| -rw-r--r-- | raveos-hyprland-theme/theme-data/dms/Widgets/DankScrollbar.qml | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/raveos-hyprland-theme/theme-data/dms/Widgets/DankScrollbar.qml b/raveos-hyprland-theme/theme-data/dms/Widgets/DankScrollbar.qml new file mode 100644 index 0000000..c5d2d70 --- /dev/null +++ b/raveos-hyprland-theme/theme-data/dms/Widgets/DankScrollbar.qml @@ -0,0 +1,46 @@ +import QtQuick +import QtQuick.Controls +import qs.Common + +ScrollBar { + id: scrollbar + + property var targetFlickable: null + readonly property var _target: targetFlickable ?? parent + + property bool _scrollBarActive: false + property alias hideTimer: hideScrollBarTimer + property bool _isParentMoving: _target && (_target.moving || _target.flicking || _target.isMomentumActive) + property bool _shouldShow: pressed || hovered || active || _isParentMoving || _scrollBarActive + + policy: (_target && _target.contentHeight > _target.height) ? ScrollBar.AsNeeded : ScrollBar.AlwaysOff + minimumSize: 0.08 + implicitWidth: 10 + interactive: true + hoverEnabled: true + z: 1000 + opacity: (policy !== ScrollBar.AlwaysOff && _shouldShow) ? 1.0 : 0.0 + visible: policy !== ScrollBar.AlwaysOff + + Behavior on opacity { + NumberAnimation { + duration: 160 + easing.type: Easing.OutQuad + } + } + + contentItem: Rectangle { + implicitWidth: 6 + radius: width / 2 + color: scrollbar.pressed ? Theme.primary : scrollbar._shouldShow ? Theme.outline : Theme.outlineMedium + opacity: scrollbar.pressed ? 1.0 : scrollbar._shouldShow ? 1.0 : 0.6 + } + + background: Item {} + + Timer { + id: hideScrollBarTimer + interval: 1200 + onTriggered: scrollbar._scrollBarActive = false + } +} |