-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Don't create a statusbar in Qt, wx backends. #17092
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
Conversation
|
||
Qt and wx backends no longer create a status bar by default | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
The coordinates information is not displayed in the toolbar, consistently with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The coordinates information is not displayed in the toolbar, consistently with | |
The coordinates information is now displayed in the toolbar, consistently with |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, just a typo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but a very confusing typo!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the motivation for unification, and I also see the argument that we don't necessarily control the status bar. However I have some concerns with this:
- The coordinates were shown in the status bar in the bottom left. Now they move to the top right in the toolbar, which may be surprising for users.
- semi-related: Some backends have the toolbar at the top of the figure window, some at the bottom. This is also confusing.
- The coordinates clunch to the top right corner of the status bar with an arbitrary margin to the right. This looks really ugly (personal taste, but really).
- If one make the figure a little smaller, the coordinates are not displayed anymore because the label is clipped
@@ -555,23 +555,21 @@ def __init__(self, canvas, num): | |||
if self.toolbar: | |||
backend_tools.add_tools_to_container(self.toolbar) | |||
self.statusbar = StatusbarQt(self.window, self.toolmanager) | |||
sb_height = self.statusbar.sizeHint().height() | |||
else: | |||
sbs_height = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo? Is this the same as sb_height
? If so, please also make sure that the variable is set via all condition code paths. If not, can we make this variables more distinctive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually they should all be sbs_height, fixed
88000b1
to
e82fc97
Compare
In general I know this may be a bit too disruptive to be worth it -- that's why I tagged as "needs comments/discussion". But I'm not sure there's much for me to argue about here, other than "I don't think it's that bad?"
Well, fixing that would be even more disruptive :-)
Looks like it was just a matter of
|
Probably. I'm not categorically opposed, but we should consider this in our decision.
Yes, that's better, but only half of it. Can we center the label vertically? I don't see a reason why we need to align it to the top (
Merged. Please rebase so that I can test that more easily 😄.
looks good. |
Rebased.
Agreed centered looks better; changed that. |
Arch + Breeze Dark (also for GTK, per https://wiki.archlinux.org/index.php/Uniform_look_for_Qt_and_GTK_applications#Styles_for_both_Qt_and_GTK). Probably would be nice to have the same thing in wx to make buttons light when on a dark background as you did for Qt (that was great :-)), but I don't use wx often enough for this to be worth the trouble... |
I was about to write that, but couldn't get the dark backfround to test. |
@timhoffm If you want to fix icon colors for dark themes + gtk, I have a mostly working patch at https://gist.github.com/anntzer/8909837f8438210538336651a87aed9c; feel free to adopt it. @ImportanceOfBeingErnest I'm a bit confused by what you're saying about resizes due to the coordinates being shown? Most often I'd assume you use the mouse to resize the window, in which case the cursor is not over the canvas and thus no coordinates are being shown? I agree the situation with very small windows is perhaps not great. OTOH the other solutions are either 1) to also move the text to the statusbar for tk/gtk/macosx (not sure for the last one), together with, hopefully, a consistent decision as to what to do in the embedding case where we may or may not control the statusbar; or 2) to just not bother about consistency here at all. |
Maybe it's not actually obvious from the screen capture above, but the problem is that the window and hence the figure resizes itself because while the mouse is over the figure, the coordinates change and thereby the width of the nav bar. |
Ah, but that just looks like a bug? The window should just keep its size and crop the text as appropriate? |
Might be a bug, but if the text is cropped, you have no chance of reading the text. |
Fair enough, but I cannot think of another program which changes its window size just because a label would be cropped. Thinking about it again, another option would be to switch to a tooltip when the label would be cropped... |
Is it really that bad if the coordinates are not displayed for small plots? I'd argue that you don't have much precision in small plots anyway so the benefit would be limited. But tooltip might be good. |
Do you have an implementation, or was that just some inkscaping? :-) |
No implementation, just 20 seconds of making a screenshot and putting a text box in it. |
Ok, so over the toolbar semms fine? |
I think so. The widget would only cover up the underlying buttons, if the figure is small, and in all the "usual" cases it would look exactly as if the label was part of the widget layout, right? I would say that such small aestetical problem is bearable. |
Will over the tool bar will cover the axes annotations if they are against the edge of the figure (ie after calling constrained/tight layout)? |
(I think) we're currently discussing something along the lines of the right image in this comment. |
Yes.
Yes.
Just a bit more work, but not anything difficult, so sure (it's just measuring toolbar height and manual positioning and yada yada). |
I guess I prefer that to the left image, but, still kinda looks like a mistake. I'd be fine if the toolbar were 12 points higher and the output went above... |
...though I guess it would only cover the toolbar if it were in a small window? I guess that seems fine. |
Yes, it's only for tiny windows that this matters. |
The sketched tooltip examples look like graphics errors to me. Waiting for the actual tooltip, but I think I don‘t like the covering of the controls. It could be an alternative to collapse all controls into a dropdown toolbutton if there is not enough space. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, this is good as is (If the window gets too small, coordinates are not shown; but with the new precision-aware formatting the coordinates are not too large.)
I'm having a bit of trouble following this discussion. @ImportanceOfBeingErnest can you comment on if you are happy with where this landed? If so please merge it for 3.3, if not we can push it to 3.4. |
rebased |
Qt will add a little arrow when the toolbar is overfull, so moving the label there will not cause the same behaviour as in Tk. Whether we should instead move the label into a tooltip or overlay is a different question, but as this brings our backends in line with each other, I'm 👍 on this even if we don't answer the broader question yet. |
On wx, it uses GTK as its backend (for me), which crops the toolbar as well, so no weird figure resizing either. Not sure what other toolkits it might use. |
Display the coordinates text on the right of the toolbar, consistently with the GTK3, wx, and (I think?) macosx backends. This helps when embedding Matplotlib in larger GUIs, because Matplotlib may not necessarily control the statusbar (which is typically global for the whole window) but controls the toolbar if there's one. If we decide to go this route we could probably also kill the status bar for toolmanager.
Display the coordinates text on the right of the toolbar, consistently
with the GTK3, wx, and (I think?) macosx backends. This helps when
embedding Matplotlib in larger GUIs, because Matplotlib may not
necessarily control the statusbar (which is typically global for the
whole window) but controls the toolbar if there's one.
If we decide to go this route we could probably also kill the status bar
for toolmanager.
xref #17085.
PR Summary
PR Checklist