colour -> color, behaviour -> behavior, centre -> center, favourite -> favorite, and about twenty other pairs, applied consistently across comments, docs, error/UI copy, and a handful of QML identifiers that used the British spelling as their actual name: SystemSettings' serialiseValue/serialiseTable/normaliseGradient, Displays' normaliseModes, Wallpaper's normalisePolicy, SettingsBackup's serialiseHomeState, DateTime's ntpSynchronised property, Clipboard's _normalise helper, and ShortcutCapture's cancelled signal (with its onCancelled handler in ShortcutsPage.qml). Every call site and the two tests that assert on the literal source text (settings-ownership and settings-backup-live contracts) were updated in lockstep. Left untouched: config/dot/espanso/match/packages/misspell-en/ is a vendored third-party autocorrect dictionary -- its entries are typo corrections, not our prose, and rewriting them would fight the package's own purpose (and any future re-sync from upstream). The already-American `favorites` property (Home page pinned accessories) was never actually misspelled -- only nearby comments and error strings said "favourites" -- so no data migration was needed there. Claude-Session: https://claude.ai/code/session_01E6TJUAh41HaP25MVHWkhRZ
54 lines
1.4 KiB
QML
54 lines
1.4 KiB
QML
// One glyph + percentage pair inside VitalsWidget. Split out so the three
|
|
// fields cannot drift apart in spacing, width or color thresholds.
|
|
|
|
import QtQuick
|
|
import qs.config
|
|
|
|
Row {
|
|
id: root
|
|
|
|
required property string glyph
|
|
required property real value
|
|
|
|
property int warnAt: 70
|
|
property int dangerAt: 90
|
|
|
|
spacing: 4
|
|
|
|
Text {
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
text: root.glyph
|
|
font.family: Theme.fontMono
|
|
font.pixelSize: Theme.fontSize
|
|
color: Theme.fgDim
|
|
}
|
|
|
|
Text {
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
text: Math.round(root.value) + "%"
|
|
|
|
// Tabular figures and a fixed width so the row doesn't jitter as digits
|
|
// change — a moving bar is far more distracting than a wide one. Sans,
|
|
// not mono: this is UI text, not terminal output.
|
|
font.family: Theme.fontFamily
|
|
font.features: Theme.tabularFigures
|
|
font.pixelSize: Theme.fontSizeSmall
|
|
horizontalAlignment: Text.AlignRight
|
|
width: 30
|
|
|
|
color: {
|
|
if (root.value >= root.dangerAt)
|
|
return Theme.danger;
|
|
if (root.value >= root.warnAt)
|
|
return Theme.warn;
|
|
return Theme.fg;
|
|
}
|
|
|
|
Behavior on color {
|
|
ColorAnimation {
|
|
duration: Theme.durFast
|
|
}
|
|
}
|
|
}
|
|
}
|