summaryrefslogtreecommitdiff
path: root/modules/launcher/AppList.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-17 15:55:26 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-17 15:55:26 +1000
commit2dbec4489eabc68c071c8bdf5451af2284e20485 (patch)
tree1ee8e8fafdc4fc3b59b1960c510f4942359eb3e5 /modules/launcher/AppList.qml
parentlauncher: notify on scheme mode change error (diff)
downloadcaelestia-shell-2dbec4489eabc68c071c8bdf5451af2284e20485.tar.gz
caelestia-shell-2dbec4489eabc68c071c8bdf5451af2284e20485.tar.bz2
caelestia-shell-2dbec4489eabc68c071c8bdf5451af2284e20485.zip
feat: impl scheme launcher action
Diffstat (limited to 'modules/launcher/AppList.qml')
-rw-r--r--modules/launcher/AppList.qml98
1 files changed, 60 insertions, 38 deletions
diff --git a/modules/launcher/AppList.qml b/modules/launcher/AppList.qml
index b2b9f57..2a54f60 100644
--- a/modules/launcher/AppList.qml
+++ b/modules/launcher/AppList.qml
@@ -10,14 +10,16 @@ import QtQuick.Controls
ListView {
id: root
- required property int padding
required property TextField search
required property PersistentProperties visibilities
property bool isAction: search.text.startsWith(Config.launcher.actionPrefix)
+ property bool isScheme: search.text.startsWith(`${Config.launcher.actionPrefix}scheme `)
function getModelValues() {
let text = search.text;
+ if (isScheme)
+ return Schemes.fuzzyQuery(text);
if (isAction)
return Actions.fuzzyQuery(text);
if (text.startsWith(Config.launcher.actionPrefix))
@@ -43,7 +45,13 @@ ListView {
opacity: 0.08
}
- delegate: isAction ? actionItem : appItem
+ delegate: {
+ if (isScheme)
+ return schemeItem;
+ if (isAction)
+ return actionItem;
+ return appItem;
+ }
ScrollBar.vertical: StyledScrollBar {}
@@ -110,44 +118,58 @@ ListView {
}
}
+ Component {
+ id: schemeItem
+
+ SchemeItem {
+ visibilities: root.visibilities
+ }
+ }
+
Behavior on isAction {
- SequentialAnimation {
- ParallelAnimation {
- Anim {
- target: root
- property: "opacity"
- from: 1
- to: 0
- duration: Appearance.anim.durations.small
- easing.bezierCurve: Appearance.anim.curves.standardAccel
- }
- Anim {
- target: root
- property: "scale"
- from: 1
- to: 0.9
- duration: Appearance.anim.durations.small
- easing.bezierCurve: Appearance.anim.curves.standardAccel
- }
+ ChangeAnim {}
+ }
+
+ Behavior on isScheme {
+ ChangeAnim {}
+ }
+
+ component ChangeAnim: SequentialAnimation {
+ ParallelAnimation {
+ Anim {
+ target: root
+ property: "opacity"
+ from: 1
+ to: 0
+ duration: Appearance.anim.durations.small
+ easing.bezierCurve: Appearance.anim.curves.standardAccel
+ }
+ Anim {
+ target: root
+ property: "scale"
+ from: 1
+ to: 0.9
+ duration: Appearance.anim.durations.small
+ easing.bezierCurve: Appearance.anim.curves.standardAccel
+ }
+ }
+ PropertyAction {}
+ ParallelAnimation {
+ Anim {
+ target: root
+ property: "opacity"
+ from: 0
+ to: 1
+ duration: Appearance.anim.durations.small
+ easing.bezierCurve: Appearance.anim.curves.standardDecel
}
- PropertyAction {}
- ParallelAnimation {
- Anim {
- target: root
- property: "opacity"
- from: 0
- to: 1
- duration: Appearance.anim.durations.small
- easing.bezierCurve: Appearance.anim.curves.standardDecel
- }
- Anim {
- target: root
- property: "scale"
- from: 0.9
- to: 1
- duration: Appearance.anim.durations.small
- easing.bezierCurve: Appearance.anim.curves.standardDecel
- }
+ Anim {
+ target: root
+ property: "scale"
+ from: 0.9
+ to: 1
+ duration: Appearance.anim.durations.small
+ easing.bezierCurve: Appearance.anim.curves.standardDecel
}
}
}