diff --git a/apps/widChargingStatus/widget.ts b/apps/widChargingStatus/widget.ts index 02f3cd8d4..a161d5408 100644 --- a/apps/widChargingStatus/widget.ts +++ b/apps/widChargingStatus/widget.ts @@ -6,11 +6,11 @@ ); const iconWidth = 18; - function draw(this: { x: number; y: number }) { + function draw(this: { x?: number; y?: number }) { g.reset(); if (Bangle.isCharging()) { g.setColor('#FD0'); - g.drawImage(icon, this.x + 1, this.y + 1, { + g.drawImage(icon, this.x! + 1, this.y! + 1, { scale: 0.6875, }); } diff --git a/typescript/types/main.d.ts b/typescript/types/main.d.ts index 1505c6f5a..d33c905d0 100644 --- a/typescript/types/main.d.ts +++ b/typescript/types/main.d.ts @@ -83,7 +83,10 @@ type WidgetArea = "tl" | "tr" | "bl" | "br"; type Widget = { area: WidgetArea; width: number; - draw: (this: { x: number; y: number }) => void; + sortorder?: number; + draw: (this: Widget, w: Widget) => void; + x?: number; + y?: number; }; declare const WIDGETS: { [key: string]: Widget };