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

Feature request: Blur (or something) when timer is paused and/or focus is lost #196

Open
WyrdByWord opened this issue Aug 10, 2022 · 3 comments

Comments

@WyrdByWord
Copy link

Different sites and such handle this in different ways, but it would be great if there was an option to have the current puzzle blurred out, or otherwise obscured, when the timer is paused or the window focus is lost. Thanks for your consideration!

@fncll
Copy link

fncll commented Aug 12, 2022

This already happens with change of focus, but I agree that having an option to invoke the same thing when the timer is paused would be useful.

@mrichards42
Copy link
Owner

mrichards42 commented Aug 13, 2022

Yep, this happens if the window loses focus or is minimized. Making this happen when the timer is paused seems like a reasonable request to me, though we'd probably want to make it an option. Either way most of the complicated logic already exists: XGridCtrl::SetPaused makes the grid render a "(Paused)" message, so we'd just need to tie that to the timer instead of the focus state.

I haven't had a ton of time recently to focus on adding features, but it would likely look like this if someone is excited to pick this up:

  1. Add the setting -- that's a bool on MyFrame, plus UI via wxFormBuilder in src/dialogs/
  2. Change the MyFrame::ToggleTimer method to call XGridCtrl::SetPaused if the above setting is in effect
  3. Change the MyFrame::OnTimerNotify method to check the above setting in addition to the app focus state to determine if the grid should be paused or not.

Here's a PR with a good example of what it looks like to add a setting: https://github.com/mrichards42/xword/pull/64/files (note that all the changes to *.fbp files are ui edits using wxFormBuilder, not something you're supposed to edit by hand)

@jpd236
Copy link
Contributor

jpd236 commented Aug 13, 2022

One thing to think about here - the timer automatically pauses when the puzzle is done (and/or a solver would likely stop the timer upon full completion of the grid). You might not want to hide the grid in that situation - when every square is filled, or something similar? - to avoid interfering with that scenario.

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

No branches or pull requests

4 participants