[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
ColumnLayout {
id: settingsColumn
anchors {
left: parent.left
right: parent.right
top: parent.top
margins: PlasmaCore.Units.smallSpacing
fill: parent
topMargin: PlasmaCore.Units.smallSpacing * 2
leftMargin: PlasmaCore.Units.smallSpacing
rightMargin: PlasmaCore.Units.smallSpacing
}
spacing: PlasmaCore.Units.smallSpacing * 2
@ -125,34 +123,31 @@ PlasmaComponents3.Page {
profileHolds: dialog.profileHolds
onActivateProfileRequested: dialog.activateProfileRequested(profile)
}
}
PlasmaComponents3.ScrollView {
// HACK: workaround for https://bugreports.qt.io/browse/QTBUG-83890
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
}
PlasmaComponents3.ScrollView {
// HACK: workaround for https://bugreports.qt.io/browse/QTBUG-83890
PlasmaComponents3.ScrollBar.horizontal.policy: PlasmaComponents3.ScrollBar.AlwaysOff
ListView {
id: batteryList
// additional margin, because the bottom of PowerProfileItem
// 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
spacing: PlasmaCore.Units.smallSpacing * 2
boundsBehavior: Flickable.StopAtBounds
spacing: PlasmaCore.Units.smallSpacing * 2
KeyNavigation.tab: brightnessSlider
KeyNavigation.backtab: pmSwitch
KeyNavigation.tab: brightnessSlider
KeyNavigation.backtab: pmSwitch
delegate: BatteryItem {
width: ListView.view.width
battery: model
matchHeightOfSlider: brightnessSlider.slider
delegate: BatteryItem {
width: ListView.view.width
battery: model
matchHeightOfSlider: brightnessSlider.slider
}
}
}
}

Loading…
Cancel
Save