don't show notification when it shouldn't

This commit is contained in:
Marco Martin 2020-09-01 17:40:09 +02:00
parent c2d71ad6f2
commit 4a5ac4a6aa
2 changed files with 9 additions and 3 deletions

View file

@ -27,10 +27,13 @@ DrawerBackground {
property Item applet property Item applet
property ObjectModel fullRepresentationModel property ObjectModel fullRepresentationModel
property ListView fullRepresentationView property ListView fullRepresentationView
visible: applet && (applet.status != PlasmaCore.Types.HiddenStatus && applet.status != PlasmaCore.Types.PassiveStatus) visible: shouldBeVisible
property bool shouldBeVisible: applet && (applet.status != PlasmaCore.Types.HiddenStatus && applet.status != PlasmaCore.Types.PassiveStatus)
height: parent.height height: parent.height
width: visible ? quickSettingsParent.width : 0 width: visible ? quickSettingsParent.width : 0
Layout.minimumHeight: applet && applet.switchHeight Layout.minimumHeight: applet && applet.switchHeight
onShouldBeVisibleChanged: fullContainer.visible = fullContainer.shouldBeVisible
onVisibleChanged: { onVisibleChanged: {
if (visible) { if (visible) {
for (var i = 0; i < fullRepresentationModel.count; ++i) { for (var i = 0; i < fullRepresentationModel.count; ++i) {
@ -47,6 +50,9 @@ DrawerBackground {
fullRepresentationModel.remove(ObjectModel.index); fullRepresentationModel.remove(ObjectModel.index);
fullRepresentationView.forceLayout(); fullRepresentationView.forceLayout();
} }
if (!shouldBeVisible) {
visible = false;
}
} }
Connections { Connections {
target: fullContainer.applet target: fullContainer.applet

View file

@ -302,10 +302,10 @@ Item {
} }
} }
ListView { ListView {
id: fullRepresentationView id: fullRepresentationView
z: 1 z: 1
interactive: width < contentWidth
//parent: slidingPanel.wideScreen ? slidingPanel.flickable.contentItem : panelContents //parent: slidingPanel.wideScreen ? slidingPanel.flickable.contentItem : panelContents
Layout.preferredWidth: slidingPanel.wideScreen ? Math.min(slidingPanel.width/2, quickSettingsParent.width*fullRepresentationModel.count) : panelContents.width Layout.preferredWidth: slidingPanel.wideScreen ? Math.min(slidingPanel.width/2, quickSettingsParent.width*fullRepresentationModel.count) : panelContents.width
//Layout.fillWidth: true //Layout.fillWidth: true
@ -328,7 +328,7 @@ Item {
orientation: ListView.Horizontal orientation: ListView.Horizontal
MouseArea { MouseArea {
//parent: fullRepresentationView.contentItem parent: fullRepresentationView.contentItem
anchors.fill: parent anchors.fill: parent
z: -1 z: -1