refactor: migrate bar to new font API
This commit is contained in:
parent
3a30fcc730
commit
77dbcf5a88
15 changed files with 41 additions and 51 deletions
|
|
@ -86,8 +86,7 @@ Item {
|
||||||
id: metrics
|
id: metrics
|
||||||
|
|
||||||
text: root.windowTitle
|
text: root.windowTitle
|
||||||
font.pointSize: root.Tokens.font.size.smaller
|
font: root.Tokens.font.mono.small
|
||||||
font.family: root.Tokens.font.family.mono
|
|
||||||
elide: Qt.ElideRight
|
elide: Qt.ElideRight
|
||||||
elideWidth: root.maxHeight - icon.height
|
elideWidth: root.maxHeight - icon.height
|
||||||
|
|
||||||
|
|
@ -112,8 +111,7 @@ Item {
|
||||||
anchors.top: icon.bottom
|
anchors.top: icon.bottom
|
||||||
anchors.topMargin: Tokens.spacing.small
|
anchors.topMargin: Tokens.spacing.small
|
||||||
|
|
||||||
font.pointSize: metrics.font.pointSize
|
font: metrics.font
|
||||||
font.family: metrics.font.family
|
|
||||||
color: root.colour
|
color: root.colour
|
||||||
opacity: root.current === this ? 1 : 0
|
opacity: root.current === this ? 1 : 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,7 @@ StyledRect {
|
||||||
|
|
||||||
horizontalAlignment: StyledText.AlignHCenter
|
horizontalAlignment: StyledText.AlignHCenter
|
||||||
text: Time.format("ddd\nd")
|
text: Time.format("ddd\nd")
|
||||||
font.pointSize: Tokens.font.size.smaller
|
font: Tokens.font.body.small
|
||||||
font.family: Tokens.font.family.sans
|
|
||||||
color: root.colour
|
color: root.colour
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -63,8 +62,7 @@ StyledRect {
|
||||||
|
|
||||||
horizontalAlignment: StyledText.AlignHCenter
|
horizontalAlignment: StyledText.AlignHCenter
|
||||||
text: Time.format(GlobalConfig.services.useTwelveHourClock ? "hh\nmm\nA" : "hh\nmm")
|
text: Time.format(GlobalConfig.services.useTwelveHourClock ? "hh\nmm\nA" : "hh\nmm")
|
||||||
font.pointSize: Tokens.font.size.smaller
|
font: Tokens.font.mono.small
|
||||||
font.family: Tokens.font.family.mono
|
|
||||||
color: root.colour
|
color: root.colour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ import qs.utils
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
implicitWidth: Math.round(Tokens.font.size.large * 1.2)
|
implicitWidth: Math.round(Tokens.font.body.large.pointSize * 1.2)
|
||||||
implicitHeight: Math.round(Tokens.font.size.large * 1.2)
|
implicitHeight: Math.round(Tokens.font.body.large.pointSize * 1.2)
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
@ -30,8 +30,8 @@ Item {
|
||||||
id: caelestiaLogo
|
id: caelestiaLogo
|
||||||
|
|
||||||
Logo {
|
Logo {
|
||||||
implicitWidth: Math.round(Tokens.font.size.large * 1.6)
|
implicitWidth: Math.round(Tokens.font.body.large.pointSize * 1.6)
|
||||||
implicitHeight: Math.round(Tokens.font.size.large * 1.6)
|
implicitHeight: Math.round(Tokens.font.body.large.pointSize * 1.6)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -40,7 +40,7 @@ Item {
|
||||||
|
|
||||||
ColouredIcon {
|
ColouredIcon {
|
||||||
source: SysInfo.osLogo
|
source: SysInfo.osLogo
|
||||||
implicitSize: Math.round(Tokens.font.size.large * 1.2)
|
implicitSize: Math.round(Tokens.font.body.large.pointSize * 1.2)
|
||||||
colour: Colours.palette.m3tertiary
|
colour: Colours.palette.m3tertiary
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ Item {
|
||||||
|
|
||||||
text: "power_settings_new"
|
text: "power_settings_new"
|
||||||
color: Colours.palette.m3error
|
color: Colours.palette.m3error
|
||||||
font.bold: true
|
font: Tokens.font.icon.builders.medium.weight(Font.Bold).build()
|
||||||
font.pointSize: Tokens.font.size.normal
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ StyledRect {
|
||||||
animate: true
|
animate: true
|
||||||
text: Hypr.kbLayout
|
text: Hypr.kbLayout
|
||||||
color: root.colour
|
color: root.colour
|
||||||
font.family: Tokens.font.family.mono
|
font: Tokens.font.mono.medium
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ StyledRect {
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.bottomMargin: Config.bar.tray.background ? Tokens.padding.extraSmall : -Tokens.padding.extraSmall
|
anchors.bottomMargin: Config.bar.tray.background ? Tokens.padding.extraSmall : -Tokens.padding.extraSmall
|
||||||
text: "expand_less"
|
text: "expand_less"
|
||||||
font.pointSize: Tokens.font.size.large
|
font: Tokens.font.icon.large
|
||||||
rotation: root.expanded ? 180 : 0
|
rotation: root.expanded ? 180 : 0
|
||||||
|
|
||||||
Behavior on rotation {
|
Behavior on rotation {
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ MouseArea {
|
||||||
required property SystemTrayItem modelData
|
required property SystemTrayItem modelData
|
||||||
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
implicitWidth: Tokens.font.size.small * 2
|
implicitWidth: Tokens.font.body.small.pointSize * 2
|
||||||
implicitHeight: Tokens.font.size.small * 2
|
implicitHeight: Tokens.font.body.small.pointSize * 2
|
||||||
|
|
||||||
onClicked: event => {
|
onClicked: event => {
|
||||||
if (event.button === Qt.LeftButton)
|
if (event.button === Qt.LeftButton)
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ Item {
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: Hypr.activeToplevel?.title ?? ""
|
text: Hypr.activeToplevel?.title ?? ""
|
||||||
font.pointSize: Tokens.font.size.normal
|
font: Tokens.font.body.medium
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -77,7 +77,7 @@ Item {
|
||||||
|
|
||||||
text: "chevron_right"
|
text: "chevron_right"
|
||||||
|
|
||||||
font.pointSize: Tokens.font.size.large
|
font: Tokens.font.icon.large
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ Item {
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: qsTr("Output device")
|
text: qsTr("Output device")
|
||||||
font.weight: 500
|
font: Tokens.font.body.builders.medium.weight(500).build()
|
||||||
}
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
|
|
@ -55,7 +55,7 @@ Item {
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.topMargin: Tokens.spacing.medium
|
Layout.topMargin: Tokens.spacing.medium
|
||||||
text: qsTr("Input device")
|
text: qsTr("Input device")
|
||||||
font.weight: 500
|
font: Tokens.font.body.builders.medium.weight(500).build()
|
||||||
}
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
|
|
@ -75,7 +75,7 @@ Item {
|
||||||
Layout.topMargin: Tokens.spacing.medium
|
Layout.topMargin: Tokens.spacing.medium
|
||||||
Layout.bottomMargin: -Tokens.spacing.extraSmall
|
Layout.bottomMargin: -Tokens.spacing.extraSmall
|
||||||
text: qsTr("Volume (%1)").arg(Audio.muted ? qsTr("Muted") : `${Math.round(Audio.volume * 100)}%`)
|
text: qsTr("Volume (%1)").arg(Audio.muted ? qsTr("Muted") : `${Math.round(Audio.volume * 100)}%`)
|
||||||
font.weight: 500
|
font: Tokens.font.body.builders.medium.weight(500).build()
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomMouseArea {
|
CustomMouseArea {
|
||||||
|
|
|
||||||
|
|
@ -72,8 +72,7 @@ Column {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: qsTr("Performance Degraded")
|
text: qsTr("Performance Degraded")
|
||||||
color: Colours.palette.m3onError
|
color: Colours.palette.m3onError
|
||||||
font.family: Tokens.font.family.mono
|
font: Tokens.font.mono.builders.medium.weight(500).build()
|
||||||
font.weight: 500
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
|
|
@ -214,7 +213,7 @@ Column {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
text: parent.icon
|
text: parent.icon
|
||||||
font.pointSize: Tokens.font.size.large
|
font: Tokens.font.icon.large
|
||||||
color: profiles.current === text ? Colours.palette.m3onPrimary : Colours.palette.m3onSurface
|
color: profiles.current === text ? Colours.palette.m3onPrimary : Colours.palette.m3onSurface
|
||||||
fill: profiles.current === text ? 1 : 0
|
fill: profiles.current === text ? 1 : 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ ColumnLayout {
|
||||||
Layout.topMargin: Tokens.padding.medium
|
Layout.topMargin: Tokens.padding.medium
|
||||||
Layout.rightMargin: Tokens.padding.extraSmall
|
Layout.rightMargin: Tokens.padding.extraSmall
|
||||||
text: qsTr("Bluetooth")
|
text: qsTr("Bluetooth")
|
||||||
font.weight: 500
|
font: Tokens.font.body.builders.medium.weight(500).build()
|
||||||
}
|
}
|
||||||
|
|
||||||
Toggle {
|
Toggle {
|
||||||
|
|
@ -57,7 +57,7 @@ ColumnLayout {
|
||||||
return available;
|
return available;
|
||||||
}
|
}
|
||||||
color: Colours.palette.m3onSurfaceVariant
|
color: Colours.palette.m3onSurfaceVariant
|
||||||
font.pointSize: Tokens.font.size.small
|
font: Tokens.font.body.small
|
||||||
}
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ ColumnLayout {
|
||||||
Layout.topMargin: visible ? Tokens.padding.medium : 0
|
Layout.topMargin: visible ? Tokens.padding.medium : 0
|
||||||
Layout.rightMargin: Tokens.padding.extraSmall
|
Layout.rightMargin: Tokens.padding.extraSmall
|
||||||
text: qsTr("Wireless")
|
text: qsTr("Wireless")
|
||||||
font.weight: 500
|
font: Tokens.font.body.builders.medium.weight(500).build()
|
||||||
}
|
}
|
||||||
|
|
||||||
Toggle {
|
Toggle {
|
||||||
|
|
@ -47,7 +47,7 @@ ColumnLayout {
|
||||||
Layout.rightMargin: Tokens.padding.extraSmall
|
Layout.rightMargin: Tokens.padding.extraSmall
|
||||||
text: qsTr("%1 networks available").arg(Nmcli.networks.length) // qmllint disable missing-property
|
text: qsTr("%1 networks available").arg(Nmcli.networks.length) // qmllint disable missing-property
|
||||||
color: Colours.palette.m3onSurfaceVariant
|
color: Colours.palette.m3onSurfaceVariant
|
||||||
font.pointSize: Tokens.font.size.small
|
font: Tokens.font.body.small
|
||||||
}
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
|
|
@ -97,7 +97,7 @@ ColumnLayout {
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
visible: networkItem.modelData.isSecure
|
visible: networkItem.modelData.isSecure
|
||||||
text: "lock"
|
text: "lock"
|
||||||
font.pointSize: Tokens.font.size.small
|
font: Tokens.font.icon.small
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
|
@ -106,7 +106,7 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: networkItem.modelData.ssid
|
text: networkItem.modelData.ssid
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font.weight: networkItem.modelData.active ? 500 : 400
|
font: Tokens.font.body.builders.medium.weight(networkItem.modelData.active ? 500 : 400).build()
|
||||||
color: networkItem.modelData.active ? Colours.palette.m3primary : Colours.palette.m3onSurface
|
color: networkItem.modelData.active ? Colours.palette.m3primary : Colours.palette.m3onSurface
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -221,7 +221,7 @@ ColumnLayout {
|
||||||
Layout.topMargin: visible ? Tokens.padding.medium : 0
|
Layout.topMargin: visible ? Tokens.padding.medium : 0
|
||||||
Layout.rightMargin: Tokens.padding.extraSmall
|
Layout.rightMargin: Tokens.padding.extraSmall
|
||||||
text: qsTr("Ethernet")
|
text: qsTr("Ethernet")
|
||||||
font.weight: 500
|
font: Tokens.font.body.builders.medium.weight(500).build()
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
|
@ -231,7 +231,7 @@ ColumnLayout {
|
||||||
Layout.rightMargin: Tokens.padding.extraSmall
|
Layout.rightMargin: Tokens.padding.extraSmall
|
||||||
text: qsTr("%1 devices available").arg(Nmcli.ethernetDevices.length)
|
text: qsTr("%1 devices available").arg(Nmcli.ethernetDevices.length)
|
||||||
color: Colours.palette.m3onSurfaceVariant
|
color: Colours.palette.m3onSurfaceVariant
|
||||||
font.pointSize: Tokens.font.size.small
|
font: Tokens.font.body.small
|
||||||
}
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
|
|
@ -283,7 +283,7 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: ethernetItem.modelData.interface || qsTr("Unknown")
|
text: ethernetItem.modelData.interface || qsTr("Unknown")
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font.weight: ethernetItem.modelData.connected ? 500 : 400
|
font: Tokens.font.body.builders.medium.weight(ethernetItem.modelData.connected ? 500 : 400).build()
|
||||||
color: ethernetItem.modelData.connected ? Colours.palette.m3primary : Colours.palette.m3onSurface
|
color: ethernetItem.modelData.connected ? Colours.palette.m3primary : Colours.palette.m3onSurface
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -148,8 +148,7 @@ StackView {
|
||||||
id: labelMetrics
|
id: labelMetrics
|
||||||
|
|
||||||
text: item.modelData.text
|
text: item.modelData.text
|
||||||
font.pointSize: label.font.pointSize
|
font: label.font
|
||||||
font.family: label.font.family
|
|
||||||
|
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
elideWidth: root.Tokens.sizes.bar.trayMenuWidth - (icon.active ? icon.implicitWidth + label.anchors.leftMargin : 0) - (expand.active ? expand.implicitWidth + root.Tokens.spacing.medium : 0)
|
elideWidth: root.Tokens.sizes.bar.trayMenuWidth - (icon.active ? icon.implicitWidth + label.anchors.leftMargin : 0) - (expand.active ? expand.implicitWidth + root.Tokens.spacing.medium : 0)
|
||||||
|
|
|
||||||
|
|
@ -177,14 +177,13 @@ ColumnLayout {
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
text: "lock"
|
text: "lock"
|
||||||
font.pointSize: Tokens.font.size.extraLarge * 2
|
font: Tokens.font.icon.builders.extraLarge.size(Tokens.font.icon.extraLarge.pointSize * 2).build()
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
text: qsTr("Enter password")
|
text: qsTr("Enter password")
|
||||||
font.pointSize: Tokens.font.size.large
|
font: Tokens.font.body.builders.large.weight(500).build()
|
||||||
font.weight: 500
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
|
@ -201,7 +200,7 @@ ColumnLayout {
|
||||||
return qsTr("Network: Unknown");
|
return qsTr("Network: Unknown");
|
||||||
}
|
}
|
||||||
color: Colours.palette.m3outline
|
color: Colours.palette.m3outline
|
||||||
font.pointSize: Tokens.font.size.small
|
font: Tokens.font.body.small
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
|
|
@ -249,8 +248,7 @@ ColumnLayout {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
color: connectButton.hasError ? Colours.palette.m3error : Colours.palette.m3onSurfaceVariant
|
color: connectButton.hasError ? Colours.palette.m3error : Colours.palette.m3onSurfaceVariant
|
||||||
font.pointSize: Tokens.font.size.small
|
font: Tokens.font.body.builders.small.weight(400).build()
|
||||||
font.weight: 400
|
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
Layout.maximumWidth: parent.width - Tokens.padding.extraLargeIncreased
|
Layout.maximumWidth: parent.width - Tokens.padding.extraLargeIncreased
|
||||||
}
|
}
|
||||||
|
|
@ -375,8 +373,7 @@ ColumnLayout {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: qsTr("Password")
|
text: qsTr("Password")
|
||||||
color: Colours.palette.m3outline
|
color: Colours.palette.m3outline
|
||||||
font.pointSize: Tokens.font.size.normal
|
font: Tokens.font.mono.medium
|
||||||
font.family: Tokens.font.family.mono
|
|
||||||
opacity: passwordContainer.passwordBuffer ? 0 : 1
|
opacity: passwordContainer.passwordBuffer ? 0 : 1
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
|
|
@ -391,7 +388,7 @@ ColumnLayout {
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
implicitWidth: fullWidth
|
implicitWidth: fullWidth
|
||||||
implicitHeight: Tokens.font.size.normal
|
implicitHeight: Tokens.font.body.medium.pointSize
|
||||||
|
|
||||||
orientation: Qt.Horizontal
|
orientation: Qt.Horizontal
|
||||||
spacing: Tokens.spacing.extraSmall
|
spacing: Tokens.spacing.extraSmall
|
||||||
|
|
@ -471,7 +468,7 @@ ColumnLayout {
|
||||||
id: cancelButton
|
id: cancelButton
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.minimumHeight: Tokens.font.size.normal + Tokens.padding.medium * 2
|
Layout.minimumHeight: Tokens.font.body.medium.pointSize + Tokens.padding.normal * 2
|
||||||
inactiveColour: Colours.palette.m3secondaryContainer
|
inactiveColour: Colours.palette.m3secondaryContainer
|
||||||
inactiveOnColour: Colours.palette.m3onSecondaryContainer
|
inactiveOnColour: Colours.palette.m3onSecondaryContainer
|
||||||
text: qsTr("Cancel")
|
text: qsTr("Cancel")
|
||||||
|
|
@ -486,7 +483,7 @@ ColumnLayout {
|
||||||
property bool hasError: false
|
property bool hasError: false
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.minimumHeight: Tokens.font.size.normal + Tokens.padding.medium * 2
|
Layout.minimumHeight: Tokens.font.body.medium.pointSize + Tokens.padding.normal * 2
|
||||||
inactiveColour: Colours.palette.m3primary
|
inactiveColour: Colours.palette.m3primary
|
||||||
inactiveOnColour: Colours.palette.m3onPrimary
|
inactiveOnColour: Colours.palette.m3onPrimary
|
||||||
text: qsTr("Connect")
|
text: qsTr("Connect")
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ ColumnLayout {
|
||||||
Layout.topMargin: Tokens.padding.medium
|
Layout.topMargin: Tokens.padding.medium
|
||||||
Layout.rightMargin: Tokens.padding.extraSmall
|
Layout.rightMargin: Tokens.padding.extraSmall
|
||||||
text: qsTr("Keyboard Layouts")
|
text: qsTr("Keyboard Layouts")
|
||||||
font.weight: 500
|
font: Tokens.font.body.builders.medium.weight(500).build()
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
|
|
@ -155,7 +155,7 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: kb.activeLabel
|
text: kb.activeLabel
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font.weight: 500
|
font: Tokens.font.body.builders.medium.weight(500).build()
|
||||||
color: Colours.palette.m3primary
|
color: Colours.palette.m3primary
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue