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

[boxclk] - v0.04 Update #2837

Merged
merged 1 commit into from
Jun 26, 2023
Merged

[boxclk] - v0.04 Update #2837

merged 1 commit into from
Jun 26, 2023

Conversation

stweedo
Copy link
Contributor

@stweedo stweedo commented Jun 25, 2023

Improves responsiveness of background apps that also use the touchscreen (such as Pattern Launcher) by only using the drag handler if a box is actively selected.

@stweedo
Copy link
Contributor Author

stweedo commented Jun 26, 2023

I made another branch with some code I've been testing to add clock info compatibility.

A couple of things I'm still trying to figure out with the clock info menus:

  1. Getting them to redraw properly
  2. How to make them moveable like the other boxes.

I've only been focusing on issue 1 so far. I've tried merging the two draw functions (main and clock info), I've tried calling the clock info draw function both at the end and after the main one. The module handles when to redraw, right? How do I make sure it redraws after every screen refresh?

I think 2 should be doable by switching over to the pixel coordinates in boxPos and using those after loading the initial clock info menus. Currently the generated clock info menu data from the module is stored in the clockInfoMenus object. Maybe it's just a matter of having the module use the boxPos in the boxes for the menus just like the text boxes?

@gfwilliams
Copy link
Member

Thanks! I don't know if it helps in this case but 2v18 has http://www.espruino.com/Reference#l_E_stopEventPropagation which will allow you to stop events being passed down the list of on(... handlers.

For redraw, I'm pretty sure if you've got let clockInfoMenu = require("clock_info").addInteractive(...) all you need to do is call clockInfoMenu.redraw()

And hopefully for moving,you just have to change clockInfoMenu.x/y and it should be ok too... I think the only gotcha will be making sure you set clockInfoMenu.focus=false when dragging to stop the clockinfo picking up swipe events while you drag

@gfwilliams gfwilliams merged commit 2ac8660 into espruino:master Jun 26, 2023
@stweedo
Copy link
Contributor Author

stweedo commented Jun 26, 2023

Awesome! Thanks for looking into it. I'll try your suggestions later.

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.

2 participants