Issue with Text Background Color Not Transferring via ‘summary’ Component to pageMain.qml
Hello everyone,
I’m working on a Venus OS GUI modification and facing an issue where a text element with a background color in pageBattery.qml
does not retain its background color when passed via the summary
component to pageMain.qml
.
What Works in pageBattery.qml
In pageBattery.qml
, I have successfully set a background color (red) for the text "H"
when heatFetStatus.value === 1
.
Relevant code in pageBattery.qml
:
qml
CopyEdit
summary: ["H", soc.item.format(0), dcVoltage.text, dcCurrent.text]
And inside MbItemRow
:
qml
CopyEdit
MbItemRow {
description: qsTr("Battery")
values: [
MbTextBlock {
item.value: heatFetStatus.value === 1 ? "H" : "";
width: 35; height: 25;
color: bgred; // Setting background color
visible: heatFetStatus.value === 1 && heatFetStatus.valid && versionFlag && pulse
},
MbTextBlock { item: dcVoltage; width: 90; height: 25 },
MbTextBlock { item: dcCurrent; width: 90; height: 25 },
MbTextBlock { item.bind: service.path("/Dc/0/Power"); width: 90; height: 25 }
]
}
The Issue
- When the
summary
array is passed topageMain.qml
, it correctly displays the text"H"
but loses the background color. - It seems that the
summary
component only accepts plain text and does not transfer formatting attributes like background color.
Question
How can I retain the background color of "H"
when transferring it from pageBattery.qml
to pageMain.qml
using the summary
component?
Is there a way to include text formatting (e.g., background color) in the summary
array?
Would really appreciate any insights from those familiar with Venus OS GUI or QtQuick!
Thanks in advance!