From 2dbec4489eabc68c071c8bdf5451af2284e20485 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 17 Jun 2025 15:55:26 +1000 Subject: feat: impl scheme launcher action --- modules/launcher/AppList.qml | 98 +++++++++++++++++++++++++++----------------- 1 file changed, 60 insertions(+), 38 deletions(-) (limited to 'modules/launcher/AppList.qml') 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 } } } -- cgit v1.2.3-freya