Commit 13e36301 authored by Marco Martin's avatar Marco Martin Committed by Nate Graham
Browse files

effects/windowview: Search on all screens

use a property of the effect itself to store the search text
so all the views will search for the same thing at the same time.

BUG: 455353
FIXED-IN: 5.25.1
parent a6b5efd4
Pipeline #192237 passed with stage
in 27 minutes and 15 seconds
......@@ -76,6 +76,14 @@ Item {
Layout.topMargin: PlasmaCore.Units.gridUnit
Layout.preferredWidth: Math.min(parent.width, 20 * PlasmaCore.Units.gridUnit)
focus: true
// Binding loops will be avoided from the fact that setting the text to the same won't emit textChanged
// We can't use activeFocus because is not reliable on qml effects
onTextChanged: effect.searchText = text
Binding {
target: searchField
property: "text"
value: effect.searchText
}
Keys.priority: Keys.AfterItem
Keys.forwardTo: heap
Keys.onPressed: {
......@@ -124,7 +132,7 @@ Item {
desktop: container.effect.mode == WindowView.ModeCurrentDesktop ? KWinComponents.Workspace.currentVirtualDesktop : undefined
screenName: targetScreen.name
clientModel: stackModel
filter: searchField.text
filter: effect.searchText
minimizedWindows: !effect.ignoreMinimized
windowType: ~KWinComponents.ClientFilterModel.Dock &
~KWinComponents.ClientFilterModel.Desktop &
......@@ -138,7 +146,7 @@ Item {
width: parent.width - (PlasmaCore.Units.gridUnit * 8)
visible: heap.count === 0
iconName: "edit-none"
text: searchField.text.length > 0 ? i18nd("kwin_effects", "No Matches") : i18nd("kwin_effects", "No Windows")
text: effect.searchText.length > 0 ? i18nd("kwin_effects", "No Matches") : i18nd("kwin_effects", "No Windows")
}
Repeater {
......
......@@ -24,6 +24,7 @@ class WindowViewEffect : public QuickSceneEffect
Q_PROPERTY(PresentWindowsMode mode READ mode NOTIFY modeChanged)
Q_PROPERTY(qreal partialActivationFactor READ partialActivationFactor NOTIFY partialActivationFactorChanged)
Q_PROPERTY(bool gestureInProgress READ gestureInProgress NOTIFY gestureInProgressChanged)
Q_PROPERTY(QString searchText MEMBER m_searchText NOTIFY searchTextChanged)
public:
enum PresentWindowsMode {
......@@ -84,6 +85,7 @@ Q_SIGNALS:
void modeChanged();
void layoutChanged();
void ignoreMinimizedChanged();
void searchTextChanged();
protected:
QVariantMap initialProperties(EffectScreen *screen) override;
......@@ -109,6 +111,7 @@ private:
QList<ElectricBorder> m_touchBorderActivate;
QList<ElectricBorder> m_touchBorderActivateAll;
QList<ElectricBorder> m_touchBorderActivateClass;
QString m_searchText;
Status m_status = Status::Inactive;
qreal m_partialActivationFactor = 0;
PresentWindowsMode m_mode;
......
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