nosignal-shell/modules/nexus/pages/LanguageAndRegion.qml
28allday cf3c0d823d feat(nosignal): Nerd Font icon remap — nexus (Settings)
Convert caelestia's nexus Settings to Nerd Font icons (drop-in NsIcon).

- NsIcon hardened into a MaterialIcon drop-in: accepts fontStyle (sizes from
  it, keeps the NF Mono family), plus no-op fill/grade/animate for API parity.
- Glyphs map extended with caelestia core names: nexus static icons, nav/page
  icons (palette, wallpaper, dashboard, devices_other, extension, globe, info,
  monitor, shuffle, workspaces, ...), weather + app/device icons.
- Converted all MaterialIcon in modules/nexus/ to NsIcon; fixed icon aliases
  (NavRow/SliderRow .text -> .icon); reverted IconButton font: (it has font,
  not fontStyle, and renders its own icon).

Remaining core surfaces still Material Symbols (no breakage): launcher, osd,
lock, sidebar, utilities — to convert next with any further Glyphs entries.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 11:16:01 +01:00

175 lines
5.5 KiB
QML

import QtQuick
import QtQuick.Layouts
import Caelestia.Config
import qs.components
import qs.components.controls
import qs.services
import qs.modules.nexus.common
PageBase {
id: root
// Temperature units (index 0 = Celsius, 1 = Fahrenheit — matches Weather.formatTemp)
readonly property list<MenuItem> tempItems: [
MenuItem {
text: "°C"
},
MenuItem {
text: "°F"
}
]
// Clock format (index 0 = 24-hour, 1 = 12-hour — matches Time.useTwelveHourClock)
readonly property list<MenuItem> clockItems: [
MenuItem {
text: qsTr("24-hour")
},
MenuItem {
text: qsTr("12-hour")
}
]
title: qsTr("Language & region")
ColumnLayout {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
width: root.cappedWidth
spacing: Tokens.spacing.extraSmall / 2
// Language
SectionHeader {
first: true
text: qsTr("Language")
}
// Read-only: the shell follows the system locale (no in-shell translations yet)
ConnectedRect {
Layout.fillWidth: true
first: true
last: true
implicitHeight: localeLayout.implicitHeight + localeLayout.anchors.margins * 2
RowLayout {
id: localeLayout
anchors.fill: parent
anchors.margins: Tokens.padding.medium
anchors.leftMargin: Tokens.padding.largeIncreased
anchors.rightMargin: Tokens.padding.largeIncreased
spacing: Tokens.spacing.medium
ColumnLayout {
Layout.fillWidth: true
spacing: 0
StyledText {
Layout.fillWidth: true
text: qsTr("System language")
font: Tokens.font.body.small
elide: Text.ElideRight
}
StyledText {
Layout.fillWidth: true
text: qsTr("Follows your system locale (%1)").arg(Qt.locale().name)
color: Colours.palette.m3outline
font: Tokens.font.label.small
elide: Text.ElideRight
}
}
StyledText {
text: Qt.locale().nativeLanguageName || Qt.locale().name
color: Colours.palette.m3onSurfaceVariant
font: Tokens.font.body.small
}
}
}
// Weather
SectionHeader {
text: qsTr("Weather")
}
// Placeholder until the map-based location picker lands
ConnectedRect {
Layout.fillWidth: true
first: true
last: true
implicitHeight: comingSoon.implicitHeight + Tokens.padding.extraLarge * 2
ColumnLayout {
id: comingSoon
anchors.centerIn: parent
width: parent.width - Tokens.padding.largeIncreased * 2
spacing: Tokens.padding.extraSmall
NsIcon {
Layout.alignment: Qt.AlignHCenter
icon: "map"
color: Colours.palette.m3outlineVariant
fontStyle: Tokens.font.icon.extraLarge
}
StyledText {
Layout.alignment: Qt.AlignHCenter
text: qsTr("Location picker coming soon")
color: Colours.palette.m3outlineVariant
font: Tokens.font.title.small
}
StyledText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
text: qsTr("Choose your weather location on a map in a future update")
color: Colours.palette.m3outlineVariant
font: Tokens.font.body.small
}
}
}
// Units
SectionHeader {
text: qsTr("Units")
}
SelectRow {
Layout.fillWidth: true
first: true
label: qsTr("Temperature")
subtext: qsTr("Units for weather temperatures")
menuItems: root.tempItems
active: root.tempItems[GlobalConfig.services.useFahrenheit ? 1 : 0]
onSelected: item => GlobalConfig.services.useFahrenheit = root.tempItems.indexOf(item) === 1
}
SelectRow {
Layout.fillWidth: true
last: true
label: qsTr("System temperatures")
subtext: qsTr("Units for CPU and GPU temperatures")
menuItems: root.tempItems
active: root.tempItems[GlobalConfig.services.useFahrenheitPerformance ? 1 : 0]
onSelected: item => GlobalConfig.services.useFahrenheitPerformance = root.tempItems.indexOf(item) === 1
}
// Time & date
SectionHeader {
text: qsTr("Time & date")
}
SelectRow {
Layout.fillWidth: true
first: true
last: true
label: qsTr("Clock format")
subtext: qsTr("How times are shown across the shell")
menuItems: root.clockItems
active: root.clockItems[GlobalConfig.services.useTwelveHourClock ? 1 : 0]
onSelected: item => GlobalConfig.services.useTwelveHourClock = root.clockItems.indexOf(item) === 1
}
}
}