Verified Commit 5b050270 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

applet: add `isContent` property to details

No need to mod many times.
parent 8274c4fc
Pipeline #209584 passed with stage
in 1 minute and 49 seconds
......@@ -131,18 +131,22 @@ PlasmaExtras.ExpandableListItem {
PlasmaComponents3.Label {
id: detailLabel
Layout.fillWidth: true
horizontalAlignment: index % 2 ? Text.AlignLeft : Text.AlignRight
elide: index % 2 ? Text.ElideRight : Text.ElideNone
readonly property bool isContent: index % 2
horizontalAlignment: isContent ? Text.AlignLeft : Text.AlignRight
elide: isContent ? Text.ElideRight : Text.ElideNone
font: PlasmaCore.Theme.smallestFont
text: index % 2 ? currentDeviceDetails[index] : `${currentDeviceDetails[index]}:`
textFormat: index % 2 ? Text.PlainText : Text.StyledText
text: isContent ? currentDeviceDetails[index] : `${currentDeviceDetails[index]}:`
textFormat: isContent ? Text.PlainText : Text.StyledText
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
onPressed: contextMenu.show(this, detailLabel.text, mouse.x, mouse.y)
enabled: index % 2 === 1 // only let users copy the value on the right
enabled: parent.isContent // only let users copy the value on the right
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment