[applets/batterymonitor] PopupDialog: Move battery list inside ColumnLayout

No visually observable changes, again. But it replaces most of the
anchors tweaking with a simple QtQuick.Layout interface.

You might've noticed how

    topMargin: PlasmaCore.Units.gridUnit

got replaced with a different-looking

    Layout.topMargin: PlasmaCore.Units.smallSpacing * 2

but that's all according to the plan, since this ScrollView is now
inside a ColumnLayout which has its own spacing that adds up.

Also, settingsColumn id is removed because it became unused.
wilder-5.24
ivan tkachenko 4 years ago
parent e4072e4e08
commit 8a6e5ebaad
No known key found for this signature in database
GPG Key ID: 4D197017E61437CF
  1. 51
      applets/batterymonitor/package/contents/ui/PopupDialog.qml

@ -55,13 +55,11 @@ PlasmaComponents3.Page {
focus: true focus: true
ColumnLayout { ColumnLayout {
id: settingsColumn
anchors { anchors {
left: parent.left fill: parent
right: parent.right
top: parent.top
margins: PlasmaCore.Units.smallSpacing
topMargin: PlasmaCore.Units.smallSpacing * 2 topMargin: PlasmaCore.Units.smallSpacing * 2
leftMargin: PlasmaCore.Units.smallSpacing
rightMargin: PlasmaCore.Units.smallSpacing
} }
spacing: PlasmaCore.Units.smallSpacing * 2 spacing: PlasmaCore.Units.smallSpacing * 2
@ -125,34 +123,31 @@ PlasmaComponents3.Page {
profileHolds: dialog.profileHolds profileHolds: dialog.profileHolds
onActivateProfileRequested: dialog.activateProfileRequested(profile) onActivateProfileRequested: dialog.activateProfileRequested(profile)
} }
}
PlasmaComponents3.ScrollView { PlasmaComponents3.ScrollView {
// HACK: workaround for https://bugreports.qt.io/browse/QTBUG-83890 // HACK: workaround for https://bugreports.qt.io/browse/QTBUG-83890
PlasmaComponents3.ScrollBar.horizontal.policy: PlasmaComponents3.ScrollBar.AlwaysOff PlasmaComponents3.ScrollBar.horizontal.policy: PlasmaComponents3.ScrollBar.AlwaysOff
anchors {
top: settingsColumn.bottom
left: parent.left
right: parent.right
bottom: parent.bottom
topMargin: PlasmaCore.Units.gridUnit
leftMargin: PlasmaCore.Units.smallSpacing
rightMargin: PlasmaCore.Units.smallSpacing
}
ListView { // additional margin, because the bottom of PowerProfileItem
id: batteryList // and the top of BatteryItem are more dense.
Layout.topMargin: PlasmaCore.Units.smallSpacing * 2
Layout.fillWidth: true
Layout.fillHeight: true
ListView {
id: batteryList
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
spacing: PlasmaCore.Units.smallSpacing * 2 spacing: PlasmaCore.Units.smallSpacing * 2
KeyNavigation.tab: brightnessSlider KeyNavigation.tab: brightnessSlider
KeyNavigation.backtab: pmSwitch KeyNavigation.backtab: pmSwitch
delegate: BatteryItem { delegate: BatteryItem {
width: ListView.view.width width: ListView.view.width
battery: model battery: model
matchHeightOfSlider: brightnessSlider.slider matchHeightOfSlider: brightnessSlider.slider
}
} }
} }
} }

Loading…
Cancel
Save