| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
|
||
| 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.
| The coordinates information is not displayed in the toolbar, consistently with | |
| The coordinates information is now displayed in the toolbar, consistently with |
?
Sorry, something went wrong.
There was a problem hiding this comment.
Yup, just a typo.
Sorry, something went wrong.
There was a problem hiding this comment.
but a very confusing typo!
Sorry, something went wrong.
There was a problem hiding this comment.
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:


Sorry, something went wrong.
| self.statusbar = StatusbarQt(self.window, self.toolmanager) | ||
| sb_height = self.statusbar.sizeHint().height() | ||
| else: | ||
| sbs_height = 0 |
There was a problem hiding this comment.
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?
Sorry, something went wrong.
There was a problem hiding this comment.
actually they should all be sbs_height, fixed
Sorry, something went wrong.
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 .rstrip()ing the string (done), does that help for you?
|
Sorry, something went wrong.
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 (backend_qt5.py l.716). For multi-line text the label will expand in both directions, so two lines should still be fine. There's only an issue for more lines, which then would show only the middle section, not the beginning i guess (not tested). If one wanted to be 100% save, one could change the alignment to center for single lines and top for multi line texts.
Merged. Please rebase so that I can test that more easily 😄.
looks good. |
Sorry, something went wrong.
|
Rebased.
Agreed centered looks better; changed that. |
Sorry, something went wrong.
|
Also, I think in the wx case, this is "clearly" an esthetic improvement (sure, it's all subjective, but heh): |
Sorry, something went wrong.
|
Out of curiosity: What are your system settings so that the wx toolbar is dark. I'm on Kubuntu with a dark theme. The Qt toolbar is dark as expected, but the wx toolbar is still light and also has larger icon margins: |
Sorry, something went wrong.
|
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... |
Sorry, something went wrong.
I was about to write that, but couldn't get the dark backfround to test. |
Sorry, something went wrong.
|
One reason to not use the tk backend for me was always that it resizes the figure due to the coordinates being shown inside the navigation bar. Now even if no resizing occurs in Qt, the fact that the coordinates are not visible for small figures is not desireable. |
Sorry, something went wrong.
|
@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. |
Sorry, something went wrong.
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. |
Sorry, something went wrong.
|
Ah, but that just looks like a bug? The window should just keep its size and crop the text as appropriate? |
Sorry, something went wrong.
|
Might be a bug, but if the text is cropped, you have no chance of reading the text. |
Sorry, something went wrong.
|
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... |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Do you have an implementation, or was that just some inkscaping? :-) |
Sorry, something went wrong.
|
No implementation, just 20 seconds of making a screenshot and putting a text box in it. |
Sorry, something went wrong.
|
Ok, so over the toolbar semms fine? |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
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)? |
Sorry, something went wrong.
|
(I think) we're currently discussing something along the lines of the right image in this comment. |
Sorry, something went wrong.
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). |
Sorry, something went wrong.
|
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... |
Sorry, something went wrong.
|
...though I guess it would only cover the toolbar if it were in a small window? I guess that seems fine. |
Sorry, something went wrong.
|
Yes, it's only for tiny windows that this matters. |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
There was a problem hiding this comment.
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.)
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
rebased |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
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.
| Back | FazBrowse Home | New Git URL |
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