From 0312d56af7e0794efebdcc6803a7b88a681baaa2 Mon Sep 17 00:00:00 2001 From: ivan tkachenko Date: Tue, 7 Dec 2021 09:00:06 +0300 Subject: [PATCH] [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 df2469e7d238ac070f6d87f2c403ce41470dccda. It's going to be removed completely soon. --- .../package/contents/ui/BatteryItem.qml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/applets/batterymonitor/package/contents/ui/BatteryItem.qml b/applets/batterymonitor/package/contents/ui/BatteryItem.qml index cb541d20c..7dd7a847a 100644 --- a/applets/batterymonitor/package/contents/ui/BatteryItem.qml +++ b/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 {