Merge pull request #1967 from fewieden/feature/document-all-widget-areas

Document all widget areas
master
Gordon Williams 2022-06-16 09:46:48 +01:00 committed by GitHub
commit 574736f3ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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"]={ 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 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 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 draw:draw // called to draw the widget

View File

@ -176,8 +176,9 @@ declare type GraphicsApi = {
declare const Graphics: GraphicsApi; declare const Graphics: GraphicsApi;
declare const g: GraphicsApi; declare const g: GraphicsApi;
type WidgetArea = 'tl' | 'tr' | 'bl' | 'br';
declare type Widget = { declare type Widget = {
area: 'tr' | 'tl'; area: WidgetArea;
width: number; width: number;
draw: (this: { x: number; y: number }) => void; draw: (this: { x: number; y: number }) => void;
}; };