Merge pull request #1967 from fewieden/feature/document-all-widget-areas
Document all widget areasmaster
commit
574736f3ff
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue