From 0921aaaee9d2dfda81bd3db6cccac2c5dba9821c Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 27 Oct 2026 17:08:03 +0800 Subject: refactor(standalonelauncher): inline qml -> separate file --- popups/launcher/StandaloneLauncher.qml | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 popups/launcher/StandaloneLauncher.qml (limited to 'popups/launcher') diff --git a/popups/launcher/StandaloneLauncher.qml b/popups/launcher/StandaloneLauncher.qml new file mode 100644 index 0000000..e3ab641 --- /dev/null +++ b/popups/launcher/StandaloneLauncher.qml @@ -0,0 +1,42 @@ +import Quickshell +import QtQuick + +import "components" + +LazyLoader { + id: root + + required property string componentName + + // TODO: just use the same selectionState + property QtObject selectionState: QtObject { + property Item selected: null + property string input: "" + property int cursorPosition: 0 + property var priorities: [] + property int selectedPriority: 0 + property var widgets: [] + } + + readonly property list widgets: [ + Component { + Loader { + sourceComponent: Qt.createComponent(`components/${root.componentName}.qml`) + onLoaded: { + item.standalone = true; + item.state = selectionState; + item.priority = true; + item.close.connect(() => root.active = false); + } + } + } + ] + + active: true + component: Launcher { + name: "quickshell::launcher::${component}" + widgetItems: widgets + state: selectionState + parentLoader: root + } +} -- cgit v1.2.3