Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[layout & smpltmr] New interface for Simple Timer, and changes to layout to make it work. #1788

Merged
merged 37 commits into from May 4, 2022

Conversation

sir-indy
Copy link
Contributor

@sir-indy sir-indy commented May 3, 2022

Update to Simple Timer, preview here: https://sir-indy.github.io/BangleApps/?id=smpltmr
Discussion here: http://forum.espruino.com/conversations/375342/newest/

This is a rewrite of the Simple Timer app with a new interface, including the ability to set time in seconds.

This required a few tweaks to the layout module, to:

  • center images in their container
  • allow image rotation
  • allow setting font on buttons (this feature not used in the app anymore, but left in as I can see uses for it in the future).

Remove text scale option, as scale can be set in font, as per espruino#1699
Fix onTouch while timerRunning. Previously briefly showed timer picker numbers.
Fix layout button uninitialised if timer already running.
modules/Layout.js Outdated Show resolved Hide resolved
@sir-indy
Copy link
Contributor Author

sir-indy commented May 4, 2022

Changes made to layout as suggested, and a minor tweak to the theme colours (same actual colour, just changed the reference from fg2 to the standard fg, now I think I understand a little better how themes work).
I'm happy with this now, are there any tests that I've not broken the Layout module?

@gfwilliams
Copy link
Member

Thanks - yes, there's tests/Layout/bin/runalltests.sh which does show up some differences. There were some regressions on 'master', but it looks like for your branch the button font is changed.

I just checked and in padding.js it seems your changes actually give it the correct behaviour :)

@gfwilliams gfwilliams merged commit 537744b into espruino:master May 4, 2022
@gfwilliams
Copy link
Member

Just spotted the issue with the other tests - it was just that we'd started relying on Bangle.appRect which needed faking properly. They all pass now

@sir-indy
Copy link
Contributor Author

sir-indy commented May 4, 2022

Excellent! Thank you very much for your help Gordon! You've made something that is an absolute joy to play with, and having your help with it is invaluable.
I'm planning on using the configurable button font in a keyboard app, but by default it should still be 6x8, scale 2, though now written as '6x8:2'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants