Page MenuHomeWildfire Games

Adjust game speed dropdown size
ClosedPublic

Authored by temple on Nov 21 2017, 7:14 PM.

Details

Summary

The buffer zone was removed in rP20423, but that made the entries in the dropdown take up more space, which creates an annoying scrollbar. If the dropdown size is made large enough then the scrollbar won't appear.

Before rP20423:

After rP20423:

After this patch:

Test Plan

Agree.

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

temple created this revision.Nov 21 2017, 7:14 PM
bb added a subscriber: bb.Nov 24 2017, 8:28 PM
bb added inline comments.
binaries/data/mods/public/gui/session/top_panel/button_game_speed.xml
17 ↗(On Diff #4309)

AFAIK the height of an item is 25 pixels and there are 11 items, so logical size would be 11*25=275 px, also would it make sense to just set that from js?

temple added inline comments.Nov 24 2017, 8:35 PM
binaries/data/mods/public/gui/session/top_panel/button_game_speed.xml
17 ↗(On Diff #4309)

It doesn't do any harm to go over, so maybe even set = 500 in case more speeds are added later.

bb added inline comments.Nov 24 2017, 8:42 PM
binaries/data/mods/public/gui/session/top_panel/button_game_speed.xml
17 ↗(On Diff #4309)

But that way we get a magical number (it could indeed be set to enything >= 275) everyone forgets about and will bite us again when adding more things or enlarging the item's space. Thus what is against putting it in some init somewhere?, or even better one could make a "hide_scrollbar" tag in the scrollbar xml which never gives a scrollbar when the screen resolution allows to do so. (Probably I am cracking a nutshell with a hammer though)

elexis accepted this revision.Nov 24 2017, 8:44 PM
elexis added subscribers: vladislavbelov, elexis.

I recall some patches increasing the dropdown height just like this and I agree with the diff, so acking that.
bb you can review and commit if you want.
temple if someone added something that could be perceived as a regression, it's not wrong to leave a ping @vladislavbelov

(One also could or could not look for a possibility to reduce the height of the dropdown items while still centering, or implement centering with such a buffer_zone property in source/gui/.)

This revision is now accepted and ready to land.Nov 24 2017, 8:44 PM

(XML = set of magic numbers, but if someone wants to set the height of a dropdown in all the relevant dropdowns (civ and biome choices for instance) or even support it in C++, feel free to)

bb added a comment.Nov 24 2017, 8:50 PM

(Having a partial diff for that already, would be rather simple to add such a thing later :P)

In D1053#41915, @elexis wrote:

I recall some patches increasing the dropdown height just like this and I agree with the diff, so acking that.

Right, that's where I looked to remember how it was done, D527.

binaries/data/mods/public/gui/session/top_panel/button_game_speed.xml
17 ↗(On Diff #4309)

I'm not opposed to other solutions, it just seems like this is the easiest one.

bb accepted this revision.Nov 24 2017, 11:12 PM

I am indeed cracking a nutshell with a hammer, the thing I would propose would be rather easy to implement after D1061, but that doesn't take away that this number can be set to at least 275 or whatever higher. So patch is ok, whether we make another xml entry or not could be done later if we consider it useful.

vladislavbelov accepted this revision.Nov 24 2017, 11:49 PM

I've to notice, that the problem was only for replays. Because a usual game has less number of speed types.

This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Nov 25 2017, 8:02 PM