Page MenuHomeWildfire Games

Fix Dropdown height after resizing
ClosedPublic

Authored by elexis on Jun 29 2017, 3:36 AM.
Tags
None
Referenced Files
F5202138: D692.id2749.diff
Tue, Sep 17, 9:13 AM
Unknown Object (File)
Sat, Sep 14, 8:33 PM
Unknown Object (File)
Fri, Sep 13, 12:31 PM
Unknown Object (File)
Thu, Sep 12, 8:18 PM
Unknown Object (File)
Sat, Sep 7, 11:41 PM

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.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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.

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.

source/gui/GUIManager.cpp
424 ↗(On Diff #2749)

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

428 ↗(On Diff #2749)

What's the reason of shared_ptr reset?

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

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.

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.