Skip to content
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

Make zone manager width expand up to sidebar width #79347

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Stu33
Copy link

@Stu33 Stu33 commented Jan 26, 2025

Summary

Interface "Zone manager will expand to match a wider sidebar."

Purpose of change

My excessive custom zone setup often doen't display well in the zone manager. More width would be useful, and seeing as I play on a QHD monitor I've got plenty space to allow for a wider zone manager. But I don't want to mess things up for play on smaller screens. I assume that people will play with a sidebar that leaves plenty space to see the map, so I think it's reasonable to widen the zone manager to match the sidebar if the sidebar is wider than it. I think this also looks nicer than having a bit of sidebar show behind the zones manager. I assume that 45 was selected as the zone manager size for good reason before, and reducing it would render zone labels almost uselessly truncated, so I left that as a minimum size rather than shrinking to match smaller sidebars.

Describe the solution

When the zone manager is displayed, check the width of the sidebar. If the sidebar is wider than the zone manager's 45 pixel default then use the sidebar width instead. Adjust the column positioning such that any extra width is used by the zone name column. No change was required for the zone options (particularly custom zone filters) to use the extra space.

Describe alternatives you've considered

None.

Testing

Loaded a couple of different test games and tried several different sidebar configurations. Checked that the zone manager matches the width of wider sidebars but doesn't shrink below the previous size for narrow sidebars.

Additional context

Before:
updated2-before

After - wide sidebar:
updated2-after-wide

After - narrow sidebar (so no change):
updated2-after-narrow

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. new contributor labels Jan 26, 2025
@Kilvoctu
Copy link
Contributor

Kilvoctu commented Jan 26, 2025

This looks like it's not including the changes from #79286? Can you pull in those changes and check if it still looks all right? It should behave similarly as in your screenshots, I think.
Reviewing the changed file, I guess it's updated. It's just confusing since the screenshots shown here isn't how the help text should look.

The help text I feel like should fill out the horizontal space allowed. The updates in #79286 should allow for it by simply updating the width to reference that of the zone manager window. I can do a follow-up PR for it if you don't feel like it, if this PR gets merged.
Looks like it's already doing it 👍

@Stu33
Copy link
Author

Stu33 commented Jan 26, 2025

~This looks like it's not including the changes from #79286...

I took those screenshots before merging recent changes and re-testing. I'll take new ones.

@Stu33 Stu33 marked this pull request as draft January 26, 2025 19:15
@Stu33
Copy link
Author

Stu33 commented Jan 26, 2025

I've updated the screenshots, but I've also had a thought that I should really widen the zone name display rather than leaving a big gap at the right-hand side of the widened zone manager. So I'm marking this as draft until I get that done. Thank you for making me think harder :-)

@Stu33
Copy link
Author

Stu33 commented Jan 26, 2025

I've adjusted the zone manager rendering to make better use of the increased available space and updated the screenshots again.

@Stu33 Stu33 marked this pull request as ready for review January 26, 2025 22:21
@Kilvoctu
Copy link
Contributor

Looks good!

@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions new contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants