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

Retain widget settings through switches and closes #279

Merged
merged 3 commits into from
Sep 1, 2024

Conversation

celeste-sinead
Copy link
Contributor

Overall, the intent is to make it more convenient to switch back and forth between widgets, or to temporarily show and then hide a widget, by not reverting widgets to default settings when doing this. More specifically:

  • when a dock is closed, and then a new dock is created, the new dock will have the same widget with the same settings as previously (and this works on a stack if multiple docks are closed)
  • when a dock is switched from one widget to another and then back, the initial settings will be preserved
  • the above state is persisted in application settings

This enables the following:
- add a dock
- select a different widget
- change some settings
- close that dock
- add a new dock
- new dock has the widget and settings of the one previously closed

Previous widget selections are kept on a stack, so this allows
"new dock" to undo multiple previous "close" actions. Caveat being that
if multiple instances of the same widget were closed, only the most
recent one's settings will be kept.

This isn't persisted at close, yet.
So, you can switch back and forth between differnet widgets without reverting
their settings back to default.

This state being kept at the DockManager means most recent settings become
available to other docks, which makes "moving" a widget convenient.

Still not persisted at application close ;)
So, the features introduced in the previous two patches now have persistent
state through multiple runs of the application.
@tlecomte
Copy link
Owner

tlecomte commented Sep 1, 2024

This is great @celeste-sinead, thanks.

I think this would nicely complemented with a "reset" button on each settings widget to easily go back to the defaults.

@tlecomte tlecomte merged commit 89e7243 into tlecomte:master Sep 1, 2024
4 checks passed
@celeste-sinead celeste-sinead deleted the restore_docks branch September 9, 2024 21:07
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