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
46 lines
1.6 KiB
QML
46 lines
1.6 KiB
QML
// The center clock, kept in the same place and the same format GNOME had it:
|
|
// weekday, date, 12-hour time with seconds. Clicking it opens the calendar,
|
|
// exactly like GNOME's date menu.
|
|
|
|
import Quickshell
|
|
import QtQuick
|
|
import qs.config
|
|
import qs.services
|
|
import qs.widgets
|
|
|
|
Pill {
|
|
id: root
|
|
|
|
// Seconds are only ticked when they are actually shown — a per-second wake
|
|
// for a clock that displays minutes would be pure waste.
|
|
SystemClock {
|
|
id: clock
|
|
precision: Settings.showSeconds ? SystemClock.Seconds : SystemClock.Minutes
|
|
}
|
|
|
|
readonly property string format: {
|
|
const date = Settings.showWeekday ? "ddd MMM d " : "MMM d ";
|
|
const time = Settings.use24Hour ? (Settings.showSeconds ? "HH:mm:ss" : "HH:mm") : (Settings.showSeconds ? "h:mm:ss AP" : "h:mm AP");
|
|
return date + time;
|
|
}
|
|
|
|
onActivated: ShellState.toggleDateMenu("agenda")
|
|
|
|
// Right-click opens the settings that govern this widget. Timezone and clock format live on Date & Time. The
|
|
// format toggles are mirrored on Appearance, but someone right-clicking a
|
|
// clock is far more often after the time itself than its typography.
|
|
onSecondaryActivated: ShellState.openSettings("datetime")
|
|
|
|
Text {
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
text: Qt.formatDateTime(clock.date, root.format)
|
|
font.family: Theme.fontFamily
|
|
// Seconds tick once a second in the center of the bar; without tabular
|
|
// figures the whole clock shifts sideways on every digit change.
|
|
font.features: Theme.tabularFigures
|
|
font.pixelSize: Theme.fontSize
|
|
color: Theme.fg
|
|
}
|
|
|
|
}
|