mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
shell: Fix Compact applet display popup when fullRepresentation is null
Fix https://invent.kde.org/plasma/plasma-mobile/-/issues/361 Avoid to display empty popup when fullRepresentation is set to null
This commit is contained in:
parent
38f15ced14
commit
4cd1dfaf04
1 changed files with 16 additions and 7 deletions
|
|
@ -41,7 +41,6 @@ Item {
|
|||
}
|
||||
|
||||
onFullRepresentationChanged: {
|
||||
|
||||
if (!fullRepresentation) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -49,6 +48,18 @@ Item {
|
|||
fullRepresentation.parent = appletParent;
|
||||
fullRepresentation.anchors.fill = fullRepresentation.parent;
|
||||
fullRepresentation.anchors.margins = appletParent.margins.top;
|
||||
fullRepresentation.visible = true;
|
||||
|
||||
// If plasmoidItem is expanded, we need to update expanded overlay to display it
|
||||
updateExpandedOverlay();
|
||||
}
|
||||
|
||||
function updateExpandedOverlay(): void {
|
||||
if (plasmoidItem?.expanded && fullRepresentation) {
|
||||
expandedOverlay.showFullScreen()
|
||||
} else {
|
||||
expandedOverlay.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
FocusScope {
|
||||
|
|
@ -95,18 +106,16 @@ Item {
|
|||
Connections {
|
||||
target: plasmoidItem
|
||||
function onExpandedChanged() {
|
||||
if (plasmoidItem.expanded) {
|
||||
expandedOverlay.showFullScreen()
|
||||
} else {
|
||||
expandedOverlay.visible = false;
|
||||
}
|
||||
// When plasmoidItem is expanded, it can be possible fullRepresentation is null
|
||||
// so we not need to display expandedOverlay now to avoid display empty expandedOverlay
|
||||
updateExpandedOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
NanoShell.FullScreenOverlay {
|
||||
id: expandedOverlay
|
||||
color: Qt.rgba(0, 0, 0, 0.6)
|
||||
visible: plasmoidItem && plasmoidItem.expanded
|
||||
visible: plasmoidItem?.expanded && fullRepresentation
|
||||
width: Screen.width
|
||||
height: Screen.height
|
||||
MouseArea {
|
||||
|
|
|
|||
Loading…
Reference in a new issue