Commit ce6a0ec0 authored by Nate Graham's avatar Nate Graham
Browse files

[applets/batterymonitor] Collapse inhibitions list properly

I probably introduced the issue fixed here with D29315, sorry. This patch makes the
parent layout invisible when all of its children are invisible, so it doesn't keep
taking up some vertical space after a previously-visible inhibition goes away.

Test Plan: When an inhibition goes away, it once again looks like it should: {F8288112}

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: plasma-devel

Tags: #plasma

Differential Revision:
parent 571f0aba
......@@ -60,9 +60,11 @@ ColumnLayout {
ColumnLayout {
Layout.fillWidth: true
Layout.leftMargin: units.gridUnit + units.smallSpacing // width of checkbox and spacer
visible: inhibitingAppsList.visible || laptopLidWarning.visible
spacing: units.smallSpacing
InhibitionHint {
id: laptopLidWarning
Layout.fillWidth: true
visible:["PowerDevil"] &&["PowerDevil"]["Is Lid Present"] && !["PowerDevil"]["Triggers Lid Action"] ? true : false
iconSource: "computer-laptop"
......@@ -70,6 +72,7 @@ ColumnLayout {
InhibitionHint {
id: inhibitingAppsList
Layout.fillWidth: true
visible: inhibitions.length > 0
iconSource: inhibitions.length > 0 ? inhibitions[0].Icon || "" : ""
Supports Markdown
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