summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2026-08-23 14:08:42 +0800
committerlittleblack111 <littleblack11111@gmail.com>2026-08-23 14:08:42 +0800
commit09c442f244f9d31af36004ec4be21b7062167cb2 (patch)
treed6a41601fae56595cc289feb512bdc8978873712
parent9e431a0947414b6fadc3e6c2b95e375ab629b2fc (diff)
fix(Clip): stop it stealing selected after something else already
changed it
-rw-r--r--popups/launcher/Launcher.qml1
-rw-r--r--popups/launcher/components/App.qml7
-rw-r--r--popups/launcher/components/Clip.qml12
-rw-r--r--popups/launcher/components/Emoji.qml7
-rw-r--r--popups/launcher/components/Spell.qml6
5 files changed, 21 insertions, 12 deletions
diff --git a/popups/launcher/Launcher.qml b/popups/launcher/Launcher.qml
index 2b3f40f..1e1eb89 100644
--- a/popups/launcher/Launcher.qml
+++ b/popups/launcher/Launcher.qml
@@ -424,7 +424,6 @@ ILauncher {
}
if (set !== 0) {
- // launcher.state.priorities[launcher.state.selectedPriority].syncSelectionState();
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 a4c0d2c..f3ce41d 100644
--- a/popups/launcher/components/App.qml
+++ b/popups/launcher/components/App.qml
@@ -94,7 +94,6 @@ IComponent {
}
selectedIndex = 0;
- listView.contentY = 0;
syncSelectionState();
}
@@ -109,8 +108,10 @@ IComponent {
syncSelectionState: function () {
Qt.callLater(() => {
- if (!isSelectedPriority() && state.selected === listView.itemAtIndex(selectedIndex)) {
- state.selected = null;
+ if (!isSelectedPriority()) {
+ if (state.selected === listView.itemAtIndex(selectedIndex))
+ state.selected = null;
+
return;
}
diff --git a/popups/launcher/components/Clip.qml b/popups/launcher/components/Clip.qml
index 39712ef..38df084 100644
--- a/popups/launcher/components/Clip.qml
+++ b/popups/launcher/components/Clip.qml
@@ -44,7 +44,6 @@ IComponent {
home: function () {
if (selectedIndex <= 0)
return true;
- selectedIndex = -1;
selectedIndex = 0;
}
end: function () {
@@ -60,23 +59,24 @@ IComponent {
}
selectedIndex = 0;
- listView.positionViewAtBeginning();
syncSelectionState();
}
onSelectedIndexChanged: {
if (selectedIndex >= 0 && selectedIndex < listView.count)
Qt.callLater(() => {
+ listView.positionViewAtIndex(selectedIndex, ListView.Visible);
+ syncSelectionState();
listView.positionViewAtIndex(selectedIndex, ListView.Contain);
});
-
- syncSelectionState();
}
syncSelectionState: function () {
Qt.callLater(() => {
- if (!isSelectedPriority() && state.selected === listView.itemAtIndex(selectedIndex)) {
- state.selected = null;
+ if (!isSelectedPriority()) {
+ if (state.selected && state.selected === listView.itemAtIndex(selectedIndex))
+ state.selected = null;
+
return;
}
diff --git a/popups/launcher/components/Emoji.qml b/popups/launcher/components/Emoji.qml
index f45ada0..5dc9cd6 100644
--- a/popups/launcher/components/Emoji.qml
+++ b/popups/launcher/components/Emoji.qml
@@ -97,6 +97,13 @@ IComponent {
syncSelectionState: function () {
Qt.callLater(() => {
+ if (!isSelectedPriority()) {
+ if (state.selected === listView.itemAtIndex(selectedIndex))
+ state.selected = null;
+
+ return;
+ }
+
if (!loader.view || selectedIndex < 0 || selectedIndex >= loader.view.count || !root.visible)
return;
diff --git a/popups/launcher/components/Spell.qml b/popups/launcher/components/Spell.qml
index 5e5d20a..1f8a15c 100644
--- a/popups/launcher/components/Spell.qml
+++ b/popups/launcher/components/Spell.qml
@@ -115,8 +115,10 @@ IComponent {
syncSelectionState: function () {
Qt.callLater(() => {
- if (!isSelectedPriority() && state.selected === loader.view.itemAtIndex(selectedIndex)) {
- state.selected = null;
+ if (!isSelectedPriority()) {
+ if (state.selected === listView.itemAtIndex(selectedIndex))
+ state.selected = null;
+
return;
}