From 37c357ee5ae9b72fa4678e345bf8a2e7dd219321 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Fri, 2 May 2025 20:33:23 +1000 Subject: launcher: add scrollbar Also fix height --- modules/launcher/Content.qml | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'modules/launcher') diff --git a/modules/launcher/Content.qml b/modules/launcher/Content.qml index bce3d61..edbc605 100644 --- a/modules/launcher/Content.qml +++ b/modules/launcher/Content.qml @@ -3,28 +3,32 @@ import "root:/services" import "root:/config" import Quickshell import QtQuick +import QtQuick.Controls Item { id: root required property Scope launcher + readonly property int padding: Appearance.padding.large + readonly property int spacing: Appearance.spacing.normal + readonly property int rounding: Appearance.rounding.large implicitWidth: LauncherConfig.sizes.width - implicitHeight: search.height + list.height + Appearance.padding.large * 5 // Don't question it + implicitHeight: search.height + list.height + padding * 4 + spacing anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter StyledRect { color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true) - radius: Appearance.rounding.large - implicitHeight: list.height + Appearance.padding.large * 2 + radius: root.rounding + implicitHeight: list.height + root.padding * 2 anchors.left: parent.left anchors.right: parent.right anchors.bottom: search.top - anchors.bottomMargin: Appearance.spacing.normal - anchors.margins: Appearance.padding.large + anchors.bottomMargin: root.spacing + anchors.margins: root.padding ListView { id: list @@ -42,10 +46,21 @@ Item { anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom - anchors.margins: Appearance.padding.large + anchors.margins: root.padding delegate: AppItem {} + ScrollBar.vertical: StyledScrollBar { + // Move half out + parent: list.parent + anchors.top: list.top + anchors.bottom: list.bottom + anchors.right: list.right + anchors.topMargin: root.padding / 2 + anchors.bottomMargin: root.padding / 2 + anchors.rightMargin: -root.padding / 2 + } + add: Transition { Anim { properties: "opacity,scale" @@ -93,13 +108,13 @@ Item { anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom - anchors.margins: Appearance.padding.large + anchors.margins: root.padding placeholderText: qsTr("Type \">\" for commands") background: StyledRect { color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true) - radius: Appearance.rounding.large + radius: root.rounding } onAccepted: { -- cgit v1.2.3-freya