forked from Blendman974/faceclaw
Add temperature-units config option
This commit is contained in:
1 parent
1780057f3c
commit
5256ab1ddc
8 files changed
+48
-6
No files matched your search
@@ -35,6 +35,7 @@ export type BatteryDisplayMode = "icon" | "percentage" | "stacked" | "stacked-pe
|
||||
/** When a top-bar battery indicator is shown: always, only below 50%, or never. */
|
||||
export type BatteryIndicatorVisibility = "always" | "low" | "never";
|
||||
export type TimeFormat = "24h" | "12h";
|
||||
export type TemperatureUnit = "fahrenheit" | "celsius";
|
||||
export type ScreenTimeoutSetting = "15s" | "30s" | "1m" | "3m" | "never";
|
||||
// Auto runs Faceclaw's light curve. Numeric values use the calibrated firmware
|
||||
// scale, clamped to 2–100; 2 is also the endpoint for screen fades.
|
||||
@@ -330,6 +331,16 @@ export const timeFormatSetting = new ConfigSettingEnum<TimeFormat>({
|
||||
description: "Whether the top-bar clock shows 24-hour or 12-hour time.",
|
||||
});
|
||||
|
||||
export const temperatureUnitSetting = new ConfigSettingEnum<TemperatureUnit>({
|
||||
id: "temperatureUnit",
|
||||
label: "Temperature unit",
|
||||
storageKey: "display.temperatureUnit",
|
||||
defaultValue: "fahrenheit",
|
||||
values: ["fahrenheit", "celsius"],
|
||||
formatValue: (value) => value === "celsius" ? "Celsius" : "Fahrenheit",
|
||||
description: "Whether the Weather app, its top-bar indicator, and the Glanceboard's system card show temperatures in Fahrenheit or Celsius.",
|
||||
});
|
||||
|
||||
/**
|
||||
* Where the app switcher (the open-window icons) sits: a strip along the
|
||||
* left or right edge of the display, a row under the window, or a popup box
|
||||
|
||||
@@ -76,6 +76,7 @@ import {
|
||||
saveVoiceRecordingsSetting,
|
||||
showBleBandwidthSetting,
|
||||
suspendEvenHubWhenScreenOffSetting,
|
||||
temperatureUnitSetting,
|
||||
textSettingMenuItem,
|
||||
timeFormatSetting,
|
||||
toggleSettingMenuItem,
|
||||
@@ -289,6 +290,8 @@ function customizationRows(): () => MenuItem[] {
|
||||
animationsMenuItem(),
|
||||
// Controls the top-bar clock (24-hour vs 12-hour).
|
||||
enumSettingMenuItem(timeFormatSetting),
|
||||
// Fahrenheit or Celsius, wherever weather temperatures show.
|
||||
enumSettingMenuItem(temperatureUnitSetting),
|
||||
];
|
||||
const bottomRows = [font, position, depth, statusBar, ...rest];
|
||||
const popupRows = [font, position, depth, statusBar, statusBarVisibility, windowBorder, ...rest];
|
||||
|
||||
Reference in new issue
Block a user