refactor: migrate controlcenter bluetooth to new font API
This commit is contained in:
parent
d04963160b
commit
c21c5fe552
3 changed files with 36 additions and 43 deletions
|
|
@ -59,8 +59,7 @@ StyledFlickable {
|
|||
StyledText {
|
||||
Layout.topMargin: Tokens.spacing.largeIncreased
|
||||
text: qsTr("Connection status")
|
||||
font.pointSize: Tokens.font.size.larger
|
||||
font.weight: 500
|
||||
font: Tokens.font.body.builders.large.weight(500).build()
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
|
@ -118,8 +117,7 @@ StyledFlickable {
|
|||
StyledText {
|
||||
Layout.topMargin: Tokens.spacing.largeIncreased
|
||||
text: qsTr("Device properties")
|
||||
font.pointSize: Tokens.font.size.larger
|
||||
font.weight: 500
|
||||
font: Tokens.font.body.builders.large.weight(500).build()
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
|
@ -187,7 +185,7 @@ StyledFlickable {
|
|||
|
||||
text: qsTr("Device name")
|
||||
color: Colours.palette.m3outline
|
||||
font.pointSize: Tokens.font.size.small
|
||||
font: Tokens.font.label.small
|
||||
}
|
||||
|
||||
StyledTextField {
|
||||
|
|
@ -324,8 +322,7 @@ StyledFlickable {
|
|||
StyledText {
|
||||
Layout.topMargin: Tokens.spacing.largeIncreased
|
||||
text: qsTr("Device information")
|
||||
font.pointSize: Tokens.font.size.larger
|
||||
font.weight: 500
|
||||
font: Tokens.font.body.builders.large.weight(500).build()
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
|
@ -389,7 +386,7 @@ StyledFlickable {
|
|||
StyledText {
|
||||
text: root.device?.dbusPath ?? ""
|
||||
color: Colours.palette.m3outline
|
||||
font.pointSize: Tokens.font.size.small
|
||||
font: Tokens.font.body.small
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
|
@ -400,7 +397,7 @@ StyledFlickable {
|
|||
StyledText {
|
||||
text: root.device?.address ?? ""
|
||||
color: Colours.palette.m3outline
|
||||
font.pointSize: Tokens.font.size.small
|
||||
font: Tokens.font.body.small
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
|
@ -411,7 +408,7 @@ StyledFlickable {
|
|||
StyledText {
|
||||
text: root.device?.bonded ? qsTr("Yes") : qsTr("No")
|
||||
color: Colours.palette.m3outline
|
||||
font.pointSize: Tokens.font.size.small
|
||||
font: Tokens.font.body.small
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
|
@ -422,7 +419,7 @@ StyledFlickable {
|
|||
StyledText {
|
||||
text: root.device?.deviceName ?? ""
|
||||
color: Colours.palette.m3outline
|
||||
font.pointSize: Tokens.font.size.small
|
||||
font: Tokens.font.body.small
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -557,7 +554,7 @@ StyledFlickable {
|
|||
animate: true
|
||||
text: (root.device && root.device[`${fabMenuItem.modelData.name}ed`] ? fabMenuItem.modelData.name === "connect" ? "dis" : "un" : "") + fabMenuItem.modelData.name
|
||||
color: Colours.palette.m3onPrimaryContainer
|
||||
font.capitalization: Font.Capitalize
|
||||
font: Tokens.font.body.builders.small.capitalisation(Font.Capitalize).build()
|
||||
Layout.preferredWidth: implicitWidth
|
||||
|
||||
Behavior on Layout.preferredWidth {
|
||||
|
|
@ -600,7 +597,7 @@ StyledFlickable {
|
|||
fabBg.implicitWidth: 48
|
||||
fabBg.implicitHeight: 48
|
||||
fabBg.radius: 48 / 2
|
||||
fab.font.pointSize: Tokens.font.size.larger
|
||||
fab.font: Tokens.font.icon.large
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -638,7 +635,7 @@ StyledFlickable {
|
|||
animate: true
|
||||
text: root.session.bt.fabMenuOpen ? "close" : "settings"
|
||||
color: root.session.bt.fabMenuOpen ? Colours.palette.m3onPrimary : Colours.palette.m3onPrimaryContainer
|
||||
font.pointSize: Tokens.font.size.large
|
||||
font: Tokens.font.icon.large
|
||||
fill: 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,8 +36,7 @@ DeviceList {
|
|||
|
||||
StyledText {
|
||||
text: qsTr("Bluetooth")
|
||||
font.pointSize: Tokens.font.size.large
|
||||
font.weight: 500
|
||||
font: Tokens.font.body.builders.large.weight(500).build()
|
||||
}
|
||||
|
||||
Item {
|
||||
|
|
@ -48,9 +47,9 @@ DeviceList {
|
|||
toggled: Bluetooth.defaultAdapter?.enabled ?? false
|
||||
icon: "power"
|
||||
accent: "Tertiary"
|
||||
iconSize: Tokens.font.size.normal
|
||||
horizontalPadding: Tokens.padding.medium
|
||||
verticalPadding: Tokens.padding.small
|
||||
iconSize: Tokens.font.body.medium.pointSize
|
||||
horizontalPadding: Tokens.padding.normal
|
||||
verticalPadding: Tokens.padding.smaller
|
||||
tooltip: qsTr("Toggle Bluetooth")
|
||||
|
||||
onClicked: {
|
||||
|
|
@ -64,9 +63,9 @@ DeviceList {
|
|||
toggled: Bluetooth.defaultAdapter?.discoverable ?? false
|
||||
icon: root.smallDiscoverable ? "group_search" : ""
|
||||
label: root.smallDiscoverable ? "" : qsTr("Discoverable")
|
||||
iconSize: Tokens.font.size.normal
|
||||
horizontalPadding: Tokens.padding.medium
|
||||
verticalPadding: Tokens.padding.small
|
||||
iconSize: Tokens.font.body.medium.pointSize
|
||||
horizontalPadding: Tokens.padding.normal
|
||||
verticalPadding: Tokens.padding.smaller
|
||||
tooltip: qsTr("Make discoverable")
|
||||
|
||||
onClicked: {
|
||||
|
|
@ -80,9 +79,9 @@ DeviceList {
|
|||
toggled: Bluetooth.defaultAdapter?.pairable ?? false
|
||||
icon: "missing_controller"
|
||||
label: root.smallPairable ? "" : qsTr("Pairable")
|
||||
iconSize: Tokens.font.size.normal
|
||||
horizontalPadding: Tokens.padding.medium
|
||||
verticalPadding: Tokens.padding.small
|
||||
iconSize: Tokens.font.body.medium.pointSize
|
||||
horizontalPadding: Tokens.padding.normal
|
||||
verticalPadding: Tokens.padding.smaller
|
||||
tooltip: qsTr("Make pairable")
|
||||
|
||||
onClicked: {
|
||||
|
|
@ -96,9 +95,9 @@ DeviceList {
|
|||
toggled: Bluetooth.defaultAdapter?.discovering ?? false
|
||||
icon: "bluetooth_searching"
|
||||
accent: "Secondary"
|
||||
iconSize: Tokens.font.size.normal
|
||||
horizontalPadding: Tokens.padding.medium
|
||||
verticalPadding: Tokens.padding.small
|
||||
iconSize: Tokens.font.body.medium.pointSize
|
||||
horizontalPadding: Tokens.padding.normal
|
||||
verticalPadding: Tokens.padding.smaller
|
||||
tooltip: qsTr("Scan for devices")
|
||||
|
||||
onClicked: {
|
||||
|
|
@ -112,9 +111,9 @@ DeviceList {
|
|||
toggled: !root.session.bt.active
|
||||
icon: "settings"
|
||||
accent: "Primary"
|
||||
iconSize: Tokens.font.size.normal
|
||||
horizontalPadding: Tokens.padding.medium
|
||||
verticalPadding: Tokens.padding.small
|
||||
iconSize: Tokens.font.body.medium.pointSize
|
||||
horizontalPadding: Tokens.padding.normal
|
||||
verticalPadding: Tokens.padding.smaller
|
||||
tooltip: qsTr("Bluetooth settings")
|
||||
|
||||
onClicked: {
|
||||
|
|
@ -178,7 +177,7 @@ DeviceList {
|
|||
anchors.centerIn: parent
|
||||
text: Icons.getBluetoothIcon(device.modelData ? device.modelData.icon : "")
|
||||
color: device.connected ? Colours.palette.m3onPrimaryContainer : (device.modelData && device.modelData.bonded) ? Colours.palette.m3onSecondaryContainer : Colours.palette.m3onSurface
|
||||
font.pointSize: Tokens.font.size.large
|
||||
font: Tokens.font.icon.large
|
||||
fill: device.connected ? 1 : 0
|
||||
|
||||
Behavior on fill {
|
||||
|
|
@ -202,7 +201,7 @@ DeviceList {
|
|||
Layout.fillWidth: true
|
||||
text: (device.modelData ? device.modelData.address : "") + (device.connected ? qsTr(" (Connected)") : (device.modelData && device.modelData.bonded) ? qsTr(" (Paired)") : "")
|
||||
color: Colours.palette.m3outline
|
||||
font.pointSize: Tokens.font.size.small
|
||||
font: Tokens.font.body.small
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@ ColumnLayout {
|
|||
StyledText {
|
||||
Layout.topMargin: Tokens.spacing.largeIncreased
|
||||
text: qsTr("Adapter status")
|
||||
font.pointSize: Tokens.font.size.larger
|
||||
font.weight: 500
|
||||
font: Tokens.font.body.builders.large.weight(500).build()
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
|
@ -87,8 +86,7 @@ ColumnLayout {
|
|||
StyledText {
|
||||
Layout.topMargin: Tokens.spacing.largeIncreased
|
||||
text: qsTr("Adapter properties")
|
||||
font.pointSize: Tokens.font.size.larger
|
||||
font.weight: 500
|
||||
font: Tokens.font.body.builders.large.weight(500).build()
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
|
@ -325,7 +323,7 @@ ColumnLayout {
|
|||
|
||||
text: qsTr("Rename adapter (currently does not work)")
|
||||
color: Colours.palette.m3outline
|
||||
font.pointSize: Tokens.font.size.small
|
||||
font: Tokens.font.label.small
|
||||
}
|
||||
|
||||
StyledTextField {
|
||||
|
|
@ -444,8 +442,7 @@ ColumnLayout {
|
|||
StyledText {
|
||||
Layout.topMargin: Tokens.spacing.largeIncreased
|
||||
text: qsTr("Adapter information")
|
||||
font.pointSize: Tokens.font.size.larger
|
||||
font.weight: 500
|
||||
font: Tokens.font.body.builders.large.weight(500).build()
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
|
@ -477,7 +474,7 @@ ColumnLayout {
|
|||
StyledText {
|
||||
text: Bluetooth.defaultAdapter ? BluetoothAdapterState.toString(Bluetooth.defaultAdapter.state) : qsTr("Unknown")
|
||||
color: Colours.palette.m3outline
|
||||
font.pointSize: Tokens.font.size.small
|
||||
font: Tokens.font.body.small
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
|
@ -488,7 +485,7 @@ ColumnLayout {
|
|||
StyledText {
|
||||
text: Bluetooth.defaultAdapter?.dbusPath ?? ""
|
||||
color: Colours.palette.m3outline
|
||||
font.pointSize: Tokens.font.size.small
|
||||
font: Tokens.font.body.small
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
|
@ -499,7 +496,7 @@ ColumnLayout {
|
|||
StyledText {
|
||||
text: Bluetooth.defaultAdapter?.adapterId ?? ""
|
||||
color: Colours.palette.m3outline
|
||||
font.pointSize: Tokens.font.size.small
|
||||
font: Tokens.font.body.small
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue