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

Fix minimap show/hide #1103

Merged
merged 4 commits into from
Jul 11, 2022

Conversation

lmoureaux
Copy link
Contributor

Closes #1096.

I chose not to remove the option (for now), instead implementing a more or less sensible behavior.

lmoureaux added 3 commits July 9, 2022 20:26
There is a menu item to hide the minimap. It was only toggling the minimap
without changing the layout of the panel at the bottom right, resulting in an
almost-empty widget still hiding as much of the map as before. Now, hiding the
minimap properly reduces the size of the bottom right widget, at the expense of
also hiding the zoom buttons located there.

The manual layout (i.e. without using QLayout) causes some trouble when widgets
are hidden or restored. Eventually I chose to post a LayoutRequest event by
hand to the widget doing the layout. If one day we write a proper QLayout for
the overlay widgets, we can remove this.

Closes longturn#1096.
When the minimap is hidden then shown, the three tool buttons on its right have
a negative height for one frame. This causes QPainter to be unhappy and
complain loudly. Silence most of the warnings by not attempting to render SVG
icons with negative sizes.
@lmoureaux lmoureaux requested a review from psampathkumar July 9, 2022 20:31
Copy link
Contributor

@psampathkumar psampathkumar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you dont lock the interface, it resets the position of the chat widget to the default position. That is jarring, and isnt the expected behaviour. The minimap should hide/show without involving the other widgets.

lmoureaux added a commit to lmoureaux/freeciv21 that referenced this pull request Jul 9, 2022
@lmoureaux
Copy link
Contributor Author

If you dont lock the interface, it resets the position of the chat widget to the default position. That is jarring, and isnt the expected behaviour. The minimap should hide/show without involving the other widgets.

Fixed. Yes, I used a switch with intentional [[fallthrough]] (and the C++17 attribute).

@lmoureaux lmoureaux requested a review from psampathkumar July 9, 2022 21:18
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this pull request Jul 9, 2022
@lmoureaux lmoureaux force-pushed the bugfix/minimap-show-hide branch from f8d63b3 to 9e08fec Compare July 9, 2022 21:43
@lmoureaux lmoureaux enabled auto-merge (rebase) July 9, 2022 23:21
@lmoureaux lmoureaux force-pushed the bugfix/minimap-show-hide branch from 9e08fec to c82a421 Compare July 10, 2022 22:25
@psampathkumar
Copy link
Contributor

psampathkumar commented Jul 10, 2022

Hmm! MacOS build failed!didn't expect that! 😄
Looks like a problem with the build and not with the code! Do we merge this and then fix the build later?

@psampathkumar psampathkumar disabled auto-merge July 11, 2022 00:03
@lmoureaux
Copy link
Contributor Author

Hmm! MacOS build failed!didn't expect that! smile Looks like a problem with the build and not with the code! Do we merge this and then fix the build later?

Launched a new attempt

@psampathkumar
Copy link
Contributor

Mac build works now. Merging.

@psampathkumar psampathkumar merged commit 4c6aee6 into longturn:master Jul 11, 2022
@psampathkumar psampathkumar deleted the bugfix/minimap-show-hide branch July 11, 2022 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Behaviour of "hide minimap" is broken
2 participants