From 267f043dfe88442efd5c2682925ba2b081e52b8f Mon Sep 17 00:00:00 2001 From: Felix Wiedenbach Date: Thu, 16 Jun 2022 10:28:25 +0200 Subject: [PATCH] documents all four possible widget areas --- README.md | 2 +- typescript/types/globals.d.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e8d5579c0..ea485da86 100644 --- a/README.md +++ b/README.md @@ -191,7 +191,7 @@ widget bar at the top of the screen they can add themselves to the global ``` WIDGETS["mywidget"]={ - area:"tl", // tl (top left), tr (top right) + area:"tl", // tl (top left), tr (top right), bl (bottom left), br (bottom right) sortorder:0, // (Optional) determines order of widgets in the same corner width: 24, // how wide is the widget? You can change this and call Bangle.drawWidgets() to re-layout draw:draw // called to draw the widget diff --git a/typescript/types/globals.d.ts b/typescript/types/globals.d.ts index e82c3da3d..e2da49a0e 100644 --- a/typescript/types/globals.d.ts +++ b/typescript/types/globals.d.ts @@ -33,7 +33,7 @@ done "heatshrink": "readonly", "Math": "readonly", "Modules": "readonly", "NRF": "readonly", - "Number": "readonly", + "Number": "readonly", "Object": "readonly", "OneWire": "readonly", "Pin": "readonly", @@ -176,8 +176,9 @@ declare type GraphicsApi = { declare const Graphics: GraphicsApi; declare const g: GraphicsApi; +type WidgetArea = 'tl' | 'tr' | 'bl' | 'br'; declare type Widget = { - area: 'tr' | 'tl'; + area: WidgetArea; width: number; draw: (this: { x: number; y: number }) => void; };