forked from Shinonome/dots-hyprland
wallpaper selector: style the scrollbar
This commit is contained in:
@@ -0,0 +1,26 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import qs.modules.common
|
||||||
|
import qs.modules.common.functions
|
||||||
|
|
||||||
|
ScrollBar {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
policy: ScrollBar.AsNeeded
|
||||||
|
|
||||||
|
contentItem: Rectangle {
|
||||||
|
implicitWidth: 4
|
||||||
|
implicitHeight: root.visualSize
|
||||||
|
radius: width / 2
|
||||||
|
color: Appearance.colors.colOnSurfaceVariant
|
||||||
|
|
||||||
|
opacity: root.policy === ScrollBar.AlwaysOn || (root.active && root.size < 1.0) ? 0.5 : 0
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: 350
|
||||||
|
easing.type: Appearance.animation.elementMoveFast.type
|
||||||
|
easing.bezierCurve: Appearance.animation.elementMoveFast.bezierCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -204,9 +204,7 @@ Item {
|
|||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
bottomMargin: extraOptions.implicitHeight
|
bottomMargin: extraOptions.implicitHeight
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBar {
|
ScrollBar.vertical: StyledScrollBar {}
|
||||||
policy: ScrollBar.AsNeeded
|
|
||||||
}
|
|
||||||
|
|
||||||
function moveSelection(delta) {
|
function moveSelection(delta) {
|
||||||
currentIndex = Math.max(0, Math.min(grid.model.count - 1, currentIndex + delta));
|
currentIndex = Math.max(0, Math.min(grid.model.count - 1, currentIndex + delta));
|
||||||
|
|||||||
Reference in New Issue
Block a user