Fix bottom bar wrapping in the tree tab #4693
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #4691 and #1265 .
Description of the problem being solved:
The bottom toolbar in the Tree tab does not always wrap to two lines at the right time.

Problem in #4691 was caused by the fact that the node power selector/button could be shown even if "Show node power" was not selected:
but in the logic for wrapping, it was assumed that these two items where hidden.
This was caused by the fact that during initial load, the two items does not check if show node power is selected (this check is only when the box is clicked).
I added logic in the draw-function to make sure that the visibility was set correctly. I also changed the if-statement for wrapping since it did take into account "Node Power", but not take into account if "Compare" is clicked or not.
Steps taken to verify a working solution:
Load PoB both with or without "Show Node Power" selected in the build.

With node power preselected:
Without node power preselected

Tried the wrapping with the different combinations of node power and Compare to see that it now wraps in the same spot.