Page MenuHomeWildfire Games

Fix Dropdown height after resizing
ClosedPublic

Authored by elexis on Jun 29 2017, 3:36 AM.

Details

Summary

As reported a long time ago in #3571 and most recently by temple in D689, if we have

  • a dropdown with a relative size ("x%+y") and
  • that dropdown has an entry in the list that is so long that it does word-wrapping
  • and we resize the window with alt+enter or some other key comibnation to instanlty change between two resolutions like 1024x768 and 1920x1280,

then we can observe that the dropdown height is wrong as it still uses the old dropdown height where the word has not been wrapped (while now it has to be / vice versa).

Therefore we must rebuild the texts after the new size is known too.

Test Plan

See above.

Event Timeline

elexis created this revision.Jun 29 2017, 3:36 AM
Vulcan added a subscriber: Vulcan.Jun 29 2017, 4:24 AM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1655/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/258/ for more details.

elexis updated this revision to Diff 2749.Jun 29 2017, 5:29 AM

As reported by temple, Engine.GetGUIObjectByName fails because it looked in the top page instead of the page were called the event in.
If we look into that function we see that it checks for m_CurrentGUI and that TickObjects changes that member.
Changing that member here as well fixes the issue.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1657/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/260/ for more details.

vladislavbelov added inline comments.Jun 29 2017, 7:31 AM
source/gui/GUIManager.cpp
424

shared_ptr assignment isn't so cheap, so should we assign it here?

428

What's the reason of shared_ptr reset?

Also why WindowResized and not PageResized, which looks more flexible.

elexis updated this revision to Diff 2752.Jun 29 2017, 12:25 PM

Uploaded to D694 instead of D692 again.
Simplification: Call CList::UpdateCachedSize() only from CDropDown::UpdateCachedSize(), not from CDropDown::SetupText().
Vladislav answered in https://code.wildfiregames.com/D694#27644

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1660/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/263/ for more details.

temple accepted this revision.Jun 29 2017, 7:54 PM

I don't know all the details, but this fixed the dropdown height bug.

This revision is now accepted and ready to land.Jun 29 2017, 7:54 PM
This revision was automatically updated to reflect the committed changes.