Commit d3bb796a authored by Fushan Wen's avatar Fushan Wen 💬 Committed by Nate Graham
Browse files

Make tooltip interactive when there is a player but no window is present

If a media player is pinned to Task Manager, after opening the media
player and switching to another virtual desktop, the media controller
will be still visible in the tooltip but cannot be interacted with.

Move hasPlayer property to ToolTipDelegate.qml, and add
mainItem.hasPlayer to interactive property of ToolTipArea to fix the bug.

BUG: 443425
parent 760f305c
......@@ -329,7 +329,7 @@ MouseArea {
location: plasmoid.location
active: !inPopup && !groupDialog.visible && plasmoid.configuration.showToolTips
interactive: model.IsWindow === true
interactive: model.IsWindow === true || mainItem.hasPlayer
mainItem: (model.IsWindow === true) ? openWindowToolTipDelegate : pinnedAppToolTipDelegate
......
......@@ -48,6 +48,10 @@ PlasmaComponents3.ScrollView {
readonly property bool isVerticalPanel: plasmoid.formFactor === PlasmaCore.Types.Vertical
readonly property string mprisSourceName: mpris2Source.sourceNameForLauncherUrl(launcherUrl, isGroup ? AppPid : pidParent)
readonly property var playerData: mprisSourceName != "" ? mpris2Source.data[mprisSourceName] : 0
readonly property bool hasPlayer: !!mprisSourceName && !!playerData
Binding on Layout.minimumWidth {
value: implicitWidth
delayed: true // Prevent early hide of tooltip (BUG439522)
......
......@@ -24,9 +24,6 @@ ColumnLayout {
property var submodelIndex
property int flatIndex: isGroup && index != undefined ? index : 0
readonly property string mprisSourceName: mpris2Source.sourceNameForLauncherUrl(toolTipDelegate.launcherUrl, isGroup ? AppPid : pidParent)
readonly property var playerData: mprisSourceName != "" ? mpris2Source.data[mprisSourceName] : 0
readonly property bool hasPlayer: !!mprisSourceName && !!playerData
readonly property bool playing: hasPlayer && playerData.PlaybackStatus === "Playing"
readonly property bool canControl: hasPlayer && playerData.CanControl
readonly property bool canPlay: hasPlayer && playerData.CanPlay
......
Markdown is supported
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