-
Notifications
You must be signed in to change notification settings - Fork 42
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
Keep scroll position when reinstantiating science_report #2330
Keep scroll position when reinstantiating science_report #2330
Conversation
c459790
to
901acc0
Compare
All views are losing their state (scroll positions etc.), tracking and restoring them is possible, but I think we should take our time to check if we could restore the old behavior from stable (not destroying the instances). I am converting this into a draft PR for now. |
Notes:
|
901acc0
to
3bc16c3
Compare
@jwrober, I updated this PR with a version I used to play LT85 until now. This change does not destroy reports/views when the player switches to the map and thus retains their state. |
Looks like it needs a |
This reverts commit f985113. Calling the `popdown*' functions causes the destructors of the views to be called. As a result, the views lose their state. Reverting this commit may use a little extra memory as the views are kept in memory, but seems to have no other negative impact and restores the behaviour known from 3.0. Closes longturn#2329
3bc16c3
to
24e44b9
Compare
This is because |
The
science_report
loses the scroll position when the view is closed. This is because the object is destroyed and therefore loses its state.This commit adds code to track the scroll position in static fields and restore the state when the
science_report
is reinstantiated.Closes #2329.
An alternative solution would be to prevent the destruction of
science_report
when the view is closed; this is the behavior in stable.