taskmanager: Use a single loader for tooltip thumbnails

This commit is contained in:
Ramil Nurmanov 2026-10-15 03:10:29 +03:00 committed by Vlad Zahorodnii
parent 376e7e7e63
commit 6bb1998379
3 changed files with 19 additions and 22 deletions

View file

@ -9,6 +9,7 @@ plasma_add_applet(org.kde.plasma.taskmanager
qml/ContextMenu.qml
qml/GroupDialog.qml
qml/GroupExpanderOverlay.qml
qml/IconThumbnail.qml
qml/main.qml
qml/MouseHandler.qml
qml/PipeWireThumbnail.qml

View file

@ -0,0 +1,15 @@
/*
SPDX-FileCopyrightText: 2026 Ramil Nurmanov <ramil2004nur@gmail.com>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick
import org.kde.kirigami as Kirigami
Kirigami.Icon {
anchors.fill: parent
source: toolTipDelegate.icon
animated: false
visible: valid
}

View file

@ -263,25 +263,6 @@ ColumnLayout {
hovered: true
}
// Windows hidden from screencasts must not leak their contents through the thumbnail, show the icon instead
Loader {
active: Plasmoid.configuration.showToolTips
&& root.isExcludedFromCapture
&& !toolTipDelegate.isLauncher
&& !albumArtImage.visible
&& root.index !== -1 // Avoid loading when the instance is going to be destroyed
asynchronous: true
visible: active
anchors.fill: hoverHandler
anchors.margins: Kirigami.Units.smallSpacing * 2
sourceComponent: Kirigami.Icon {
source: toolTipDelegate.icon
animated: false
visible: valid
}
}
Loader {
id: pipeWireLoader
anchors.fill: hoverHandler
@ -292,12 +273,12 @@ ColumnLayout {
active: Plasmoid.configuration.showToolTips
&& !toolTipDelegate.isLauncher
&& !albumArtImage.visible
&& toolTipDelegate.isReadyForPainting
&& !root.isExcludedFromCapture
&& (toolTipDelegate.isReadyForPainting || root.isExcludedFromCapture)
&& root.index !== -1
asynchronous: true
//In a loader since we might not have PipeWire available yet (WITH_PIPEWIRE could be undefined in plasma-workspace/libtaskmanager/declarative/taskmanagerplugin.cpp)
source: "PipeWireThumbnail.qml"
// Windows excluded from capture must not leak their contents, so show the icon instead
source: root.isExcludedFromCapture ? "IconThumbnail.qml" : "PipeWireThumbnail.qml"
}
Loader {