From 39a3b53bfb4e8a17e3a347b21d014e3406653303 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 22 Nov 2022 12:05:21 +0100 Subject: [PATCH] windowview: Only create PlaceholderMessage when needed If there's windows and we're not searching, we don't need the PlaceholderMessage. So only create it when we actually need it to reduce the time needed to activate the effect. --- src/effects/windowview/qml/main.qml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/effects/windowview/qml/main.qml b/src/effects/windowview/qml/main.qml index ff2dcd011c..6ec43d680e 100644 --- a/src/effects/windowview/qml/main.qml +++ b/src/effects/windowview/qml/main.qml @@ -90,11 +90,12 @@ Item { } } - PlasmaExtras.PlaceholderMessage { + Loader { anchors.centerIn: parent width: parent.width - (PlasmaCore.Units.gridUnit * 8) - visible: heap.activeEmpty + active: heap.activeEmpty + // Otherwise it's always 100% opaque even while the blurry desktop background's // opacity is changing, which looks weird and is different from what Overview does. opacity: container.organized ? 1 : 0 @@ -102,8 +103,10 @@ Item { OpacityAnimator { duration: container.effect.animationDuration; easing.type: Easing.OutCubic } } - iconName: "edit-none" - text: effect.searchText.length > 0 ? i18nd("kwin_effects", "No Matches") : i18nd("kwin_effects", "No Windows") + sourceComponent: PlasmaExtras.PlaceholderMessage { + iconName: "edit-none" + text: effect.searchText.length > 0 ? i18nd("kwin_effects", "No Matches") : i18nd("kwin_effects", "No Windows") + } } ColumnLayout {