forked from Blendman974/faceclaw
Enhancements to Nightscout and Terminal apps
Nightscout app: Alert thresholds for canula age, cartridge volume, pump battery, time since last loop, shown in top bar. Option to always show in top bar when window is closed. Terminal app: Activity indicators in the app-switcher sidebar. </details>
This commit is contained in:
1 parent
9b70880a5b
commit
070c891577
13 files changed
+566
-71
No files matched your search
@@ -6,7 +6,7 @@ import { BATTERY_ICON_WIDTH, drawBattery } from "../../graphics/battery";
|
||||
import { readActiveNotificationIcons } from "../../native/notification-icons";
|
||||
import { readPhoneBatteryState } from "../../native/phone-battery";
|
||||
import { noteStaleDataUsed, renderPassAllowsStaleData } from "../../util/render-freshness";
|
||||
import { renderIcon, renderIconWithGlyph, type IconName } from "../../graphics/icons";
|
||||
import { renderIcon, renderIconWithGlyph, type IconActivity, type IconName } from "../../graphics/icons";
|
||||
import { batteryDisplayModeSetting, timeFormatSetting } from "../dashboard-settings";
|
||||
import { Layer } from "../layers";
|
||||
import { scrollToKeepSelectionVisible } from "../menu";
|
||||
@@ -144,9 +144,9 @@ function invertedIcon(icon: GrayImage): GrayImage {
|
||||
}
|
||||
|
||||
/** Window icon rendered from an SVG (Lucide), rendered once per size and cached. */
|
||||
export function makeSvgWindowIcon(name: IconName, glyph?: string): ShellChromeWindow["drawIcon"] {
|
||||
export function makeSvgWindowIcon(name: IconName, glyph?: string, activity?: () => IconActivity): ShellChromeWindow["drawIcon"] {
|
||||
return (image, x, y, size, inverted) => {
|
||||
const icon = glyph ? renderIconWithGlyph(name, glyph, size) : renderIcon(name, size);
|
||||
const icon = glyph || activity ? renderIconWithGlyph(name, glyph ?? "", size, activity?.() ?? "idle") : renderIcon(name, size);
|
||||
if (!icon) return;
|
||||
const dx = x + Math.max(0, ((size - icon.width) / 2) | 0);
|
||||
const dy = y + Math.max(0, ((size - icon.height) / 2) | 0);
|
||||
@@ -155,8 +155,8 @@ export function makeSvgWindowIcon(name: IconName, glyph?: string): ShellChromeWi
|
||||
}
|
||||
|
||||
/** SVG icon when a name is given, else the letter placeholder. */
|
||||
export function windowIcon(icon: IconName | undefined, letter: string, glyph?: string): ShellChromeWindow["drawIcon"] {
|
||||
return icon ? makeSvgWindowIcon(icon, glyph) : makeLetterWindowIcon(letter);
|
||||
export function windowIcon(icon: IconName | undefined, letter: string, glyph?: string, activity?: () => IconActivity): ShellChromeWindow["drawIcon"] {
|
||||
return icon ? makeSvgWindowIcon(icon, glyph, activity) : makeLetterWindowIcon(letter);
|
||||
}
|
||||
|
||||
/** Window icon backed by an arbitrary cached grayscale image renderer. */
|
||||
|
||||
Reference in new issue
Block a user