You are reading a single comment by @rigrig and its replies.
Click here to read the full conversation.
-
Perfect, thank you very much for your response (particularly the "TODO" comments in there)!
This gives me the information I need to
- draw my own background prior to any widgets and
- then to draw all widgets on top of that
Thanks a lot!
Edit:
- I followed your suggestion and implemented a modified version of "Bangle.drawWidgets" - it works like a charm!
- what surprises me, though, is the call of
g.setClipRectRect
in line 27 - is this part of the original code or did you edit it?
Edit 2:
- I found it: you edited the original code! Thus, you may perhaps want to correct that line
Thanks again for your effort!
- draw my own background prior to any widgets and
The Bangle.js 2
drawWidgets()
code is here: https://github.com/espruino/Espruino/blob/master/libs/js/banglejs/Bangle_drawWidgets_Q3.jsSo your app could override that with something like this:
You want to override
Bangle.drawWidgets()
instead of just drawing them yourself, because widgets tend to callBangle.drawWidgets()
to show/hide themself.And you need to redraw the background for the same reason: widgets can be shown/hidden, which moves other widgets around. (I guess you could keep track of widget positions to check if you really need to redraw)