From 1ec02cb54e3083e726a5e4b745aa46527fa5a496 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Fri, 2 May 2025 22:23:15 +1000 Subject: launcher: list item interactivity --- modules/launcher/AppItem.qml | 13 +++++++++++-- modules/launcher/Content.qml | 4 +++- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/launcher/AppItem.qml b/modules/launcher/AppItem.qml index cb7f615..473797a 100644 --- a/modules/launcher/AppItem.qml +++ b/modules/launcher/AppItem.qml @@ -1,4 +1,5 @@ import "root:/widgets" +import "root:/services" import "root:/config" import Quickshell import Quickshell.Widgets @@ -8,11 +9,19 @@ PaddedRect { id: root required property DesktopEntry modelData + required property Scope launcher implicitWidth: ListView.view.width padding: [Appearance.padding.smaller, Appearance.padding.normal] - radius: Appearance.rounding.normal - // color: ListView.isCurrentItem ? Appearance.alpha(Appearance.colours.m3surfaceContainerHighest, true) : "transparent" + + StateLayer { + radius: Appearance.rounding.normal + + function onClicked(): void { + Apps.launch(root.modelData); + root.launcher.launcherVisible = false; + } + } IconImage { id: icon diff --git a/modules/launcher/Content.qml b/modules/launcher/Content.qml index 92de980..4aafc3f 100644 --- a/modules/launcher/Content.qml +++ b/modules/launcher/Content.qml @@ -48,7 +48,9 @@ Item { anchors.bottom: parent.bottom anchors.margins: root.padding - delegate: AppItem {} + delegate: AppItem { + launcher: root.launcher + } ScrollBar.vertical: StyledScrollBar { // Move half out -- cgit v1.2.3-freya