summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-02 20:05:52 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-02 20:05:52 +1000
commit8a32dd8614ada54c3f8024fc8774ed960bfa46d4 (patch)
treeef5fd051a6cccc42be2b33b4ad49eda20eba84a8 /modules
parentlauncher: better app items (diff)
downloadcaelestia-shell-8a32dd8614ada54c3f8024fc8774ed960bfa46d4.tar.gz
caelestia-shell-8a32dd8614ada54c3f8024fc8774ed960bfa46d4.tar.bz2
caelestia-shell-8a32dd8614ada54c3f8024fc8774ed960bfa46d4.zip
launcher: fuzzy sort
Diffstat (limited to 'modules')
-rw-r--r--modules/launcher/AppItem.qml5
-rw-r--r--modules/launcher/Content.qml27
2 files changed, 20 insertions, 12 deletions
diff --git a/modules/launcher/AppItem.qml b/modules/launcher/AppItem.qml
index 24e0470..cb7f615 100644
--- a/modules/launcher/AppItem.qml
+++ b/modules/launcher/AppItem.qml
@@ -12,7 +12,7 @@ PaddedRect {
implicitWidth: ListView.view.width
padding: [Appearance.padding.smaller, Appearance.padding.normal]
radius: Appearance.rounding.normal
- color: Appearance.alpha(Appearance.colours.m3surfaceContainerHighest, true)
+ // color: ListView.isCurrentItem ? Appearance.alpha(Appearance.colours.m3surfaceContainerHighest, true) : "transparent"
IconImage {
id: icon
@@ -39,8 +39,7 @@ PaddedRect {
}
StyledText {
- text: root.modelData.comment
- // font.family: Appearance.font.family.mono
+ text: qsTr(root.modelData.comment || root.modelData.genericName || root.modelData.name)
font.pointSize: Appearance.font.size.small
color: Appearance.alpha(Appearance.colours.m3outline, true)
diff --git a/modules/launcher/Content.qml b/modules/launcher/Content.qml
index a41fca4..bce3d61 100644
--- a/modules/launcher/Content.qml
+++ b/modules/launcher/Content.qml
@@ -1,4 +1,5 @@
import "root:/widgets"
+import "root:/services"
import "root:/config"
import Quickshell
import QtQuick
@@ -29,14 +30,13 @@ Item {
id: list
model: ScriptModel {
- // TODO: sort
- values: DesktopEntries.applications.values.filter(x => x.name.toLowerCase().includes(search.text.toLowerCase()))
+ values: Apps.fuzzyQuery(search.text)
+ onValuesChanged: list.currentIndex = 0
}
clip: true
spacing: Appearance.spacing.small
orientation: Qt.Vertical
- verticalLayoutDirection: Qt.BottomToTop
implicitHeight: ((currentItem?.height ?? 1) + spacing) * Math.min(LauncherConfig.maxShown, count) - spacing
anchors.left: parent.left
@@ -62,17 +62,22 @@ Item {
}
}
+ move: Transition {
+ Anim {
+ property: "y"
+ }
+ }
+
addDisplaced: Transition {
Anim {
- properties: "x,y"
+ property: "y"
duration: Appearance.anim.durations.small
}
}
- removeDisplaced: Transition {
+ displaced: Transition {
Anim {
- properties: "x,y"
- duration: Appearance.anim.durations.large
+ property: "y"
}
}
@@ -97,8 +102,12 @@ Item {
radius: Appearance.rounding.large
}
- // TODO: apps service with launch
- // onAccepted: console.log(list.currentItem?.modelData.id)
+ onAccepted: {
+ if (list.currentItem) {
+ Apps.launch(list.currentItem?.modelData);
+ root.launcher.launcherVisible = false;
+ }
+ }
// TODO: key press grab focus + close on esc anywhere
Keys.onEscapePressed: root.launcher.launcherVisible = false