Verified Commit 36d93d62 authored by ivan tkachenko's avatar ivan tkachenko
Browse files

effects/overview: Bind to search field using textEdited signal

This special signal was designed to remove the need for such
bikesheddings and workarounds. Use it to react to user-driven changes.

BUG: 459202
FIXED-IN: 5.26
(cherry picked from commit d7c6a87f)
parent e177f7b5
Pipeline #233548 passed with stage
in 31 minutes and 5 seconds
......@@ -32,7 +32,6 @@ FocusScope {
function start() {
animationEnabled = true;
organized = true;
searchField.text = "";
}
function stop() {
......@@ -205,16 +204,12 @@ FocusScope {
focus: true
Keys.priority: Keys.BeforeItem
Keys.forwardTo: text && heap.count === 0 ? searchResults : heap
onTextChanged: {
text: effect.searchText
onTextEdited: {
effect.searchText = text;
heap.resetSelected();
heap.selectNextItem(WindowHeap.Direction.Down);
}
Binding {
target: searchField
property: "text"
value: effect.searchText
}
}
}
}
......@@ -227,13 +222,13 @@ FocusScope {
id: placeholderMessage
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
visible: container.organized && searchField.text && heap.count === 0
visible: container.organized && effect.searchText.length > 0 && heap.count === 0
text: i18nd("kwin_effects", "No matching windows")
}
WindowHeap {
id: heap
visible: !(container.organized && searchField.text) || heap.count !== 0
visible: !(container.organized && effect.searchText.length > 0) || heap.count !== 0
anchors.fill: parent
layout.mode: effect.layout
focus: true
......@@ -248,7 +243,7 @@ FocusScope {
desktop: KWinComponents.Workspace.currentVirtualDesktop
screenName: targetScreen.name
clientModel: stackModel
filter: searchField.text
filter: effect.searchText
minimizedWindows: !effect.ignoreMinimized
windowType: ~KWinComponents.ClientFilterModel.Dock &
~KWinComponents.ClientFilterModel.Desktop &
......@@ -287,8 +282,8 @@ FocusScope {
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width / 2
height: parent.height - placeholderMessage.height - PlasmaCore.Units.largeSpacing
queryString: searchField.text
visible: container.organized && searchField.text && heap.count === 0
queryString: effect.searchText
visible: container.organized && effect.searchText.length > 0 && heap.count === 0
onActivated: {
effect.deactivate();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment