feat: improve nexus w&s page styling

This commit is contained in:
2 * r + 2 * t 2026-06-05 00:33:36 +10:00
parent c31cb2a7f6
commit 1c689334cb
2 changed files with 40 additions and 13 deletions

View file

@ -7,6 +7,7 @@ import qs.services
StyledSwitch {
id: root
property string subtext
property bool first
property bool last
@ -39,17 +40,42 @@ StyledSwitch {
}
}
contentItem: StyledText {
id: label
contentItem: Item {
anchors.left: parent.left
anchors.right: root.indicator.left
anchors.leftMargin: Tokens.padding.large
anchors.rightMargin: Tokens.spacing.medium
text: root.text
font: Tokens.font.body.small
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
implicitWidth: column.implicitWidth
implicitHeight: column.implicitHeight
Column {
id: column
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
spacing: 0
StyledText {
anchors.left: parent.left
anchors.right: parent.right
text: root.text
font: Tokens.font.body.small
elide: Text.ElideRight
}
StyledText {
anchors.left: parent.left
anchors.right: parent.right
visible: root.subtext
text: root.subtext
color: Colours.palette.m3onSurfaceVariant
font: Tokens.font.label.small
elide: Text.ElideRight
}
}
}
}

View file

@ -138,9 +138,10 @@ ColumnLayout {
Layout.alignment: Qt.AlignHCenter
implicitWidth: root.cappedWidth
text: qsTr("Dark theme")
checked: !Colours.light
onToggled: Colours.setMode(checked ? "dark" : "light")
text: qsTr("Transparency")
subtext: qsTr("Base %1, layers %2").arg(Colours.transparency.base).arg(Colours.transparency.layers)
checked: Colours.transparency.enabled
onToggled: GlobalConfig.appearance.transparency.enabled = checked
}
ToggleRow {
@ -149,9 +150,9 @@ ColumnLayout {
implicitWidth: root.cappedWidth
last: true
text: qsTr("Transparency")
checked: Colours.transparency.enabled
onToggled: GlobalConfig.appearance.transparency.enabled = checked
text: qsTr("Dark theme")
checked: !Colours.light
onToggled: Colours.setMode(checked ? "dark" : "light")
}
Item {