Honestly, I feel like it's a step too far at the moment. Most of the clocks use hard-coded positions or manually hide widgets, so I think they would pretty much all need modifying to make them work.
Not to mention some clocks look better with widgets, some without. I can pretty much guarantee the first question after we add a global setting is "can I configure it per-clock"?
Maybe for now a solution would be to add some extra functionality to widget_utils...
So for buzz we have buzz and also buzz_menu that lets you easily add an option to your app's settings page. We could do the same here - so there's a method in widget_utils that basically does whatever was configured in settings.
Then it's more or less a one-liner in the clock, and a one-liner in the clock's settings.
If there is call for a global setting, it'd just be a matter of changing widget_utils and all the pre-modified clocks would just switch over to it automatically.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Honestly, I feel like it's a step too far at the moment. Most of the clocks use hard-coded positions or manually hide widgets, so I think they would pretty much all need modifying to make them work.
Not to mention some clocks look better with widgets, some without. I can pretty much guarantee the first question after we add a global setting is "can I configure it per-clock"?
Maybe for now a solution would be to add some extra functionality to widget_utils...
So for
buzz
we havebuzz
and alsobuzz_menu
that lets you easily add an option to your app's settings page. We could do the same here - so there's a method inwidget_utils
that basically does whatever was configured in settings.Then it's more or less a one-liner in the clock, and a one-liner in the clock's settings.
If there is call for a global setting, it'd just be a matter of changing widget_utils and all the pre-modified clocks would just switch over to it automatically.