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

Editor: keep ProjectTree's expanded state while doing simple actions #2170

Conversation

ivan-mogilko
Copy link
Contributor

Resolves #2105.

Added an ability to keep the expansion state of a project tree inside RePopulateTreeView() method.

RePopulateTreeView is a part of a IEditorComponent interface, and has 2 variants, where 1st has no args and 2nd accepts a selected item id. I did it so that state-saving is only done in the second variant, because there may be cases where whole tree must be refreshed. This may be reviewed later if necessary.

Also added a pair of BeginUpdate/EndUpdate around tree repopulation, but it does not seem to have much effect (?).

I noticed that there is a number of RePopulateTreeView calls in components, that call the 1st variant without args. I'd check these too and see if some could use the variant with node id in order to keep tree expanded.

@ivan-mogilko ivan-mogilko added type: enhancement a suggestion or necessity to have something improved what: editor related to the game editor context: ui/ux labels Oct 9, 2023
This also ensures the expanded folders will keep their state.
AddSingleItem() adds a tree node already, so there seem to be no purpose in refilling whole list.
@ivan-mogilko ivan-mogilko merged commit ff3ffab into adventuregamestudio:master Oct 13, 2023
20 checks passed
@ivan-mogilko ivan-mogilko deleted the 361--fixeditorfoldercollapsing branch October 13, 2023 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context: ui/ux type: enhancement a suggestion or necessity to have something improved what: editor related to the game editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editor: user actions in Project Explorer cause items & folders recreation, loss of folder states
1 participant