From 6a697082ade32e15c534d05da7ae0b9f12f019d0 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 1 Sep 2026 23:50:33 +0800 Subject: revert: redesign to make the next selectedpriority overwrite instead --- popups/launcher/Launcher.qml | 1 - popups/launcher/components/App.qml | 12 +++++++----- popups/launcher/components/Clip.qml | 14 ++++++++------ popups/launcher/components/IComponent.qml | 4 +--- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/popups/launcher/Launcher.qml b/popups/launcher/Launcher.qml index adacc24..fd6b851 100644 --- a/popups/launcher/Launcher.qml +++ b/popups/launcher/Launcher.qml @@ -429,7 +429,6 @@ ILauncher { } if (set !== 0) { - launcher.state.priorities[launcher.state.selectedPriority].leave(); switch (set) { case 1: if (launcher.state.selectedPriority < launcher.state.priorities.length - 1) { diff --git a/popups/launcher/components/App.qml b/popups/launcher/components/App.qml index 89f3611..a44b2ec 100644 --- a/popups/launcher/components/App.qml +++ b/popups/launcher/components/App.qml @@ -111,6 +111,13 @@ IComponent { syncSelectionState: function () { Qt.callLater(() => { + if (!isSelectedPriority()) { + if (state.selected === listView.itemAtIndex(selectedIndex)) + state.selected = null; + + return; + } + if (selectedIndex < 0 || selectedIndex >= listView.count || !root.visible) return; @@ -119,11 +126,6 @@ IComponent { }); } - onLeave: { - if (state.selected === listView.itemAtIndex(selectedIndex)) - state.selected = null; - } - IInnerComponent { id: layout fromParent: false diff --git a/popups/launcher/components/Clip.qml b/popups/launcher/components/Clip.qml index 418ced7..ab2721f 100644 --- a/popups/launcher/components/Clip.qml +++ b/popups/launcher/components/Clip.qml @@ -73,6 +73,14 @@ IComponent { syncSelectionState: function () { Qt.callLater(() => { + if (!isSelectedPriority()) { + // TODO: fix sometimes + if (state.selected && state.selected === listView.itemAtIndex(selectedIndex)) + state.selected = null; + + return; + } + if (!root.visible || selectedIndex < 0 || selectedIndex >= listView.count) return; @@ -81,12 +89,6 @@ IComponent { }); } - onLeave: { - // TODO: fix sometimes - if (state.selected && state.selected === listView.itemAtIndex(selectedIndex)) - state.selected = null; - } - IInnerComponent { id: layout fromParent: false diff --git a/popups/launcher/components/IComponent.qml b/popups/launcher/components/IComponent.qml index 70d2576..90c3ab8 100644 --- a/popups/launcher/components/IComponent.qml +++ b/popups/launcher/components/IComponent.qml @@ -66,8 +66,6 @@ IRect { }) signal close - // SAFETY: implementer should include safety checks - signal leave function _exec() { if (!exec()) @@ -129,7 +127,7 @@ IRect { if (hovered) root.trySetSelfPriority(); else - root.leave(); + root.syncSelectionState(); } } -- cgit v1.2.3