Page MenuHomeWildfire Games

Add scrollbars to all atlas tabs
ClosedPublic

Authored by bb on Aug 16 2017, 1:29 PM.

Details

Summary

Currently only the environment and cinema tab in Atlas have scrollbars, however on min res, the bottommost elements on the map and player tab are not visible. Also adding more object to these (and other) tabs is useless since they won't be visible. Thus adding scrollbars to all atlas tab.

Notice that besides the needed vertical scrolling, there is horizontal scrolling too, thus some buttons are now only visible when scrolling (e.g. random seed button). For this reason i reduced the grid width for the sim buttons, so the display is slightly nicer. this can also be done for the other buttons.

Test Plan

Open Atlas,
Resize the window to something small
Notice there are scrollbars for the sidebar for all tabs, thus all objects are visible.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bb created this revision.Aug 16 2017, 1:29 PM
elexis updated the Trac tickets for this revision.Aug 16 2017, 1:31 PM
vladislavbelov requested changes to this revision.EditedAug 16 2017, 1:44 PM
vladislavbelov added subscribers: Itms, vladislavbelov.

It throws 5 asserts on the start and 30+ (I'm tired to click Continue) during the work (before the patch it works good), because we don't have a upper bound for the wxWidgets, I have built it with the 3.1 one, @Itms.

Also tabs have different width which they start to scroll.

source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.cpp
46 ↗(On Diff #3140)

Why so? scrolledWindow is already defined as a member of the CinemaSidebar. So it's wrong, or you remove the member (but probably it could be needed in the future) or rename it.

This revision now requires changes to proceed.Aug 16 2017, 1:44 PM
bb added a comment.Aug 16 2017, 2:16 PM

Don't know why the it crashes, since it doesn't here. (maybe vulcan will shy some light...)

The different width are because there are different elements on the tabs, and those have different width. It starts scrolling when those width does not fit anymore in the width of the tab.

source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.cpp
46 ↗(On Diff #3140)

copy-paste and keeping everything in sinc, will remove in next diff

Vulcan added a subscriber: Vulcan.Aug 16 2017, 2:16 PM

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/1858/ 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/397/ for more details.

In D793#31342, @bb wrote:

Don't know why the it crashes, since it doesn't here. (maybe vulcan will shy some light...)

Which version of the wxWidgets do you use?

The different width are because there are different elements on the tabs, and those have different width. It starts scrolling when those width does not fit anymore in the width of the tab.

I think it'd better to have the same width, because the fix style, imo.

bb added a comment.Aug 16 2017, 2:46 PM
In D793#31342, @bb wrote:

Don't know why the it crashes, since it doesn't here. (maybe vulcan will shy some light...)

Which version of the wxWidgets do you use?

I guess 3.0 (could be 2.8 if it doesn't use GTK3)

The different width are because there are different elements on the tabs, and those have different width. It starts scrolling when those width does not fit anymore in the width of the tab.

I think it'd better to have the same width, because the fix style, imo.

But how? there are objects containing 3 or 4 buttons, which are simply wider than a list of checkboxes, and for scrolling at same width, the largest object on all tabs should have the same width, otherwise we end up with unneeded gui space or invisible object, both things i don't really like.

In D793#31349, @bb wrote:

I guess 3.0 (could be 2.8 if it doesn't use GTK3)

So, that's the problem, newer version throws asserts, as I said.

But how? there are objects containing 3 or 4 buttons, which are simply wider than a list of checkboxes, and for scrolling at same width, the largest object on all tabs should have the same width, otherwise we end up with unneeded gui space or invisible object, both things i don't really like.

Interesting question, I don't suggest to solve it at the current patch, but in the future. I.e. we could set minimal fixed width in pixels/percents. Currently you need always to resize, else you have unneeded gui space.

bb updated this revision to Diff 3144.Aug 16 2017, 6:54 PM
bb edited edge metadata.

remove the unneeded declaration and bumb years

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/1862/ 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/401/ for more details.

It compiles on wxWidgets 3.0 and 3.1, but 3.1 throws many asserts, before the patch too. Vertical scrollbars work good, but width/horizontal scrollbars have too big width. And it can't be resized. I.e. I can't press the Reset button. I need to scroll or my workspace will be really small.

bb added a comment.Aug 18 2017, 2:32 PM

The cause of the width issue, is that some buttons are placed horizontally and they don't have enough space, one could change that by putting the button under eachother too.

source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp
344 ↗(On Diff #3144)

s/5/2 would help on that i guess

source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp
186 ↗(On Diff #3144)

maybe same

203 ↗(On Diff #3144)

and here?

bb updated this revision to Diff 3174.Aug 18 2017, 10:43 PM

Resize button so they fit better on small screens, notice that the buttons cannot become smaller, either due tot the text inside or other object being the largest on the panel. (it doesn't seem to be in scope of this patch is fixing those too)

vladislavbelov accepted this revision.Aug 18 2017, 11:02 PM

It compiles and works good, only the Object tab is a little bit wider. The patch looks good, it adds only scroll sizers/windows an changes few sizes.

This revision is now accepted and ready to land.Aug 18 2017, 11:02 PM

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/1876/ 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/412/ for more details.

This revision was automatically updated to reflect the committed changes.