summaryrefslogtreecommitdiff
path: root/wasp/widgets.py
AgeCommit message (Collapse)Author
2021-07-25Advanced alarm appAdam Blair
Features: * Multiple alarms (up to 4) * Day of the week support * One time alarms * Snooze Changes to wasp-os for app support: * Added + and - to the 28pt and 36pt fonts * Checkboxes now require a click on the body of the checkbox if there is no label * Added a Toggle Button class that extends Button and stores a state like checkbox Signed-off-by: Adam Blair <adampblair@protonmail.com>
2021-06-20widgets: Further compact some of the internal representationsDaniel Thompson
Many widgets adopted the _im(mutable) idiom to allow us to reduce the RAM overhead of each widget. Where the immutable data considers entirely of integers smaller than 256 then we can push this just a little further by switching from a tuple to a bytes. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-20widgets: Refactor the stopwatch as a widgetDaniel Thompson
This is purely a refactoring for the purposes of code reuse. No change of behaviour is expected. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-18widgets: Add a button with a graphical iconDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-12widgets: Clarity whether spinner max is inclusive or exclusiveDaniel Thompson
Currently the spinner uses exclusive max when wrapping from low to high and inclusive max when wrapping from high to low. Fix this by adopting *inclusive* max everywhere. The call sites are similarly confused. Fix this! Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-10widgets: ConfirmationView: Restore default fontMiguel Rochefort
The title will render with the last font used, and this isn't always right for the ConfirmationView. Setting the font explicitly solves that issue. Signed-off-by: Miguel Rochefort <miguelrochefort@gmail.com>
2021-01-10widgets: ConfirmationView: Adopt the button widgetDaniel Thompson
Replace the pixelated Yes/No buttons with text based alternatives. This also required changes to the pager to change the way the redraw after changing view is implemented (improved muting and a reset of the colours). Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-10widgets: button: Add a simple Button widgetDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-03widgets: checkbox: Add a label propertyDaniel Thompson
The checkbox uses the _im(mutable) idiom to minimize the RAM overhead of its immutable properties (position and label). However it can be useful to retrieve the label to provide a property accessor. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-03widgets: Use theme colours for text labelsDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-31manager: Recategorize the theme labels for appsDaniel Thompson
By default bright and mid are white/grey tones, the ui widgets are blue and the spot colours are different variants of orange. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-30widgets: ConfirmationView: Fix hit box problemsDaniel Thompson
The ConfirmationView became broken when we converted it's images over to 2-bit RLE. That happened because the confirmation view relied on the the 1-bit RLE to dynamically generate hit boxes. Currently the code pre-calculates the hit box which is a waste of RAM. Let's rip out the existing hit box logic and replace it with much larger ("fat finger") hit targets. We make the touch() method more closely adopt the idioms of other UI components (e.g. don't return the dialog status... just whether or not we handled the touch). Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29widgets: Spinner: Add a simple spinner widgetDaniel Thompson
We are able to add this to the self tests without having to create a special page. Instead we can modify the existing notifications test to utilize the spinner. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29widgets: Checkbox: Add a simple checkbox widgetDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29widgets: ConfirmationView: minor docstring tweakDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29widgets: Slider: Adopt draw565.lighten for palette managementDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-28widgets: Reduce the size of the battery iconDaniel Thompson
Currently the battery icon is overlarge compared to other status bar icons such as the BT and notification icons (both of which are 32px high). Fix this by redrawing the battery artwork and updating the widgets in the status bar. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-13widgets: BatteryMeter: Fix theme handlingDaniel Thompson
Add the battery frame to the theme so it matches the frame used for charging and rename accordingly. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-13Added basic theming engine.kozova1
This theming engine uses a bytestring (but supports anything indexable, as long as the index results are a byte long), stored as `wasp.system._theme`. It has a default value, which should not change anything about the way this looks currently. The theme can be set via `wasp.system.set_theme`, but this should *ONLY* be used in `main.py`. `wasp.system.set_theme` will return True if it was successful, or False if the theme is of an old format. Using an old format theme will *not* crash the watch, but will use the default theme instead. To theme this, one has to use tools/themer.py (use flag -h for complete explanation) to generate a bytestring that's added in main.py (see diff). The bytestring is then loaded into 'wasp.system._theme'. Theme values can be looked up by apps by using `wasp.system.theme("theme-key")`. Theme keys appear in the function body of `wasp.system.theme()`. I've took the liberty of converting existing apps to use this method, and it seems to work well. A test theme is provided in `tools/test_theme.py` Signed-off-by: kozova1 <mug66kk@gmail.com>
2020-11-29widgets: ConfirmationView: Allow the widget to manage its own visibilityDaniel Thompson
When the buttons are pressed then the widget should be dismissed. There is no reason to make the caller handle that. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-29apps: pager: notifications: Added remove all notifications dialogAidan Houlihan
Signed-off-by: Aidan Houlihan <aidandhoulihan@gmail.com> [daniel@redfelineninja.org.uk: Minor changes to .gitignore] Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-22widgets: clock: Improve the redraw logicDaniel Thompson
Currently if we wake the watch exactly N hours (where N is integer) after it goes to sleep then the time will not be updated. Fix this the obvious way. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-21widgets: status: Add a status bar combo widgetDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-21widgets: battery: Fix a redraw bugDaniel Thompson
Currently if the real battery level is <5% then a redraw from scratch will not draw the outline of the battery. Fix this by adding a special case for negative previous states (-1 charging, -2 redraw). Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-21widgets: clock: Add a simple clock widgetDaniel Thompson
This is intended to be reused by any app that shows the clock as part of the status bar at the top of the display. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-20widgets: Rename StatusBar to NotificaitonBarDaniel Thompson
This is not (yet) a useful change but we'll be creating a new StatusBar soon. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-10widgets: Fix a broken docstringDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-07-24StatusBar: Rename and add BLE connection status iconDaniel Thompson
Notifier was a dumb name so make it better. Now that we have a decent name it should be obvious how to handle the BLE connection status icon! Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-07-19Introduction basic notification supportDaniel Thompson
This requires a modified version of Gadgetbridge and currently works by implementing the BangleJS protocol. In Gadgetbridge ensure "Sync time" is *not* set and choose "Don't pair" when adding the PineTime device.
2020-06-04Fix symbol lookup error (knob2)Daniel Thompson
2020-05-24widgets: Introduce a slider widgetDaniel Thompson
Currently the slider doesn't actually slide (because we process touch events rather than swipe events) but we've called is a slider anyway.
2020-05-14wasp: Even more docstringsDaniel Thompson
2020-04-06wasp: widgets: Add a scrolling indicatorDaniel Thompson
As we enrich the navigation options we will increasinly need to visualize between apps where up/down will switch us between rings and there up/down is needed to scroll through content.
2020-03-22Add licensing information for all wasp-os files.Daniel Thompson
2020-03-09wasp: draw565: Refactor to allow apps to focus on the drawable.Daniel Thompson
2020-02-04waps: widgets: Improve the battery meter athteticsDaniel Thompson
Add some extra internal padding and draw the battery in red when power is critically low.
2020-02-03wasp: clock: Add a simple battery meterDaniel Thompson