diff options
| -rw-r--r-- | modules/launcher/AppList.qml | 9 | ||||
| -rw-r--r-- | modules/launcher/Content.qml | 8 | ||||
| -rw-r--r-- | services/Apps.qml | 18 |
3 files changed, 20 insertions, 15 deletions
diff --git a/modules/launcher/AppList.qml b/modules/launcher/AppList.qml index d5724f8..3175402 100644 --- a/modules/launcher/AppList.qml +++ b/modules/launcher/AppList.qml @@ -10,6 +10,7 @@ ListView { required property int padding required property string search + required property Scope launcher model: ScriptModel { values: Apps.fuzzyQuery(root.search) @@ -26,10 +27,16 @@ ListView { anchors.bottom: parent.bottom anchors.margins: root.padding + highlightMoveDuration: Appearance.anim.durations.normal + + highlight: StyledRect { + radius: Appearance.rounding.normal + color: Appearance.alpha(Appearance.colours.m3surfaceContainerHighest, true) + } + delegate: AppItem { launcher: root.launcher } - // TODO highlight ScrollBar.vertical: StyledScrollBar { // Move half out diff --git a/modules/launcher/Content.qml b/modules/launcher/Content.qml index 81222b7..6784b0e 100644 --- a/modules/launcher/Content.qml +++ b/modules/launcher/Content.qml @@ -37,6 +37,7 @@ Item { padding: root.padding search: search.text + launcher: root.launcher } EmptyIndicator { @@ -73,6 +74,9 @@ Item { } } + Keys.onUpPressed: list.decrementCurrentIndex() + Keys.onDownPressed: list.incrementCurrentIndex() + Keys.onEscapePressed: root.launcher.launcherVisible = false Connections { @@ -81,8 +85,10 @@ Item { function onLauncherVisibleChanged(): void { if (root.launcher.launcherVisible) search.forceActiveFocus(); - else + else { search.text = ""; + list.currentIndex = 0; + } } } } diff --git a/services/Apps.qml b/services/Apps.qml index b78d642..453030d 100644 --- a/services/Apps.qml +++ b/services/Apps.qml @@ -5,7 +5,6 @@ import "root:/widgets" import "root:/config" import Quickshell import Quickshell.Io -import QtQuick Singleton { id: root @@ -24,22 +23,15 @@ Singleton { } function launch(entry: DesktopEntry): void { - launchProc.createObject(root, { - entry - }); + launchProc.entry = entry; + launchProc.startDetached(); } - Component { + Process { id: launchProc - Process { - required property DesktopEntry entry + property DesktopEntry entry - command: ["app2unit", "--", `${entry.id}.desktop`] - Component.onCompleted: { - startDetached(); - destroy(); - } - } + command: ["app2unit", "--", `${entry.id}.desktop`] } } |