From f3ab3573c3e482b87f59af300990d2f446d42d00 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 24 Aug 2025 16:39:50 +0700 Subject: [PATCH] wallpaper selector: style the scrollbar --- .../common/widgets/StyledScrollBar.qml | 26 +++++++++++++++++++ .../WallpaperSelectorContent.qml | 4 +-- 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 .config/quickshell/ii/modules/common/widgets/StyledScrollBar.qml diff --git a/.config/quickshell/ii/modules/common/widgets/StyledScrollBar.qml b/.config/quickshell/ii/modules/common/widgets/StyledScrollBar.qml new file mode 100644 index 000000000..ab357e09b --- /dev/null +++ b/.config/quickshell/ii/modules/common/widgets/StyledScrollBar.qml @@ -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 + } + } + } +} diff --git a/.config/quickshell/ii/modules/wallpaperSelector/WallpaperSelectorContent.qml b/.config/quickshell/ii/modules/wallpaperSelector/WallpaperSelectorContent.qml index bc6d3408a..f97909bd3 100644 --- a/.config/quickshell/ii/modules/wallpaperSelector/WallpaperSelectorContent.qml +++ b/.config/quickshell/ii/modules/wallpaperSelector/WallpaperSelectorContent.qml @@ -204,9 +204,7 @@ Item { boundsBehavior: Flickable.StopAtBounds bottomMargin: extraOptions.implicitHeight - ScrollBar.vertical: ScrollBar { - policy: ScrollBar.AsNeeded - } + ScrollBar.vertical: StyledScrollBar {} function moveSelection(delta) { currentIndex = Math.max(0, Math.min(grid.model.count - 1, currentIndex + delta));