1
0
Fork 0

documents all four possible widget areas

master
Felix Wiedenbach 2022-06-16 10:28:25 +02:00
parent 8dc1dad867
commit 267f043dfe
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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;
};