[applets/batterymonitor] BatteryItem: Unwrap BatteryDetails from Loader

It was necessary to drop the `required` qualifier from inListView
property due to a bug in Qt/QML compiler which somehow considers
`required` properties of inline components for named roles resolution,
but only when they are also directly instantiated somewhere in the file
as opposed to deferred instantiation via `Loader::sourceComponent`.

ToolTipArea::active is now bound to just false, which was the case ever
since df2469e7d2. It's going to be removed
completely soon.
wilder-5.24
ivan tkachenko 4 years ago
parent 9621b3c1b8
commit 0312d56af7
No known key found for this signature in database
GPG Key ID: 4D197017E61437CF
  1. 18
      applets/batterymonitor/package/contents/ui/BatteryItem.qml

@ -70,7 +70,7 @@ ColumnLayout {
component BatteryDetails : GridLayout {
id: detailsLayout
required property bool inListView
property bool inListView
readonly property font font: inListView ? PlasmaCore.Theme.smallestFont : PlasmaCore.Theme.defaultFont
columns: 2
@ -135,7 +135,7 @@ ColumnLayout {
PlasmaCore.ToolTipArea {
Layout.fillWidth: true
Layout.preferredHeight: infoRow.height
active: !detailsLoader.active
active: false
z: 2
mainItem: RowLayout {
@ -169,11 +169,9 @@ ColumnLayout {
level: 3
text: batteryNameLabel.text
}
Loader {
BatteryDetails {
Layout.maximumWidth: PlasmaCore.Units.gridUnit * 11
sourceComponent: BatteryDetails {
inListView: false
}
inListView: false
}
}
}
@ -238,15 +236,11 @@ ColumnLayout {
value: Number(root.battery.Percent)
}
Loader {
id: detailsLoader
BatteryDetails {
Layout.fillWidth: true
Layout.topMargin: PlasmaCore.Units.smallSpacing
sourceComponent: BatteryDetails {
inListView: true
}
inListView: true
}
InhibitionHint {

Loading…
Cancel
Save