-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Write status message in single line in Qt toolbar. #4329
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
Currently, the status message is partially hidden when embedding a Toolbar in a Qt4 app (see e.g. embedding_in_qt4_wtoolbar.py: activate the pan tool and hover the mouse over the figure; the two lines of the status messages don't fit in the toolbar). The split-line message was introduced in 3c61684 to avoid automatic horizontal expansion of the toolbar in presence of long messages (I guess) but I cannot reproduce that issue right now.
I have found a reference to the issue of If it's still reproducible it should be fixable by applying correct/additional size policies to the widgets. |
I can't replicate the horizontal expansion bug from 3c61684 in latest PyQt5 (Qt 5.4.1) and PyQt4, PySide (Qt 4.8.6) on MacOS X. I'll check Windows/Linux tomorrow in case of platform weirdness. An alternative to manual line-wrapping is |
I can confirm the old expanding window bug no longer occurs on PyQt4 or PyQt5 (on Qt 4.8.6 and Qt 5.4.1) on Windows. So I think it is safe to revert this change. However, the result is still kind of ugly, so I think it might be worth trying to improve that while we're looking here. There are two options:
The code for wrapping and stripping is as follows:
The use of
The text-eliding option can be done with:
@anntzer what do you think to either of these? |
I think shrinking is by far nicer than elision, but
|
@mfitzp Not sure how much work should go into this as MEP22 should completely revolutionise this, ensuring that the toolbar goes on a completely separate line so as to leave more room for tools. so I feel inclined to say that we should fix the example file itself rather than Qt. @tacaswell can you clarify the timetable for MEP22? I.e. will the rcParam controlling its use change straight away, or make the default rcParam switch-over at a later day. If at a later date, will we actively promote that people switch to MEP22? I ask because I guess the answers will decide whether we update the embedding docs to use MEP22 now, or at that later date. |
@mdboom and @efiring need to weigh in on the time line. We definitely need I know it is annoyingly conservative, but we can't break existing user code. On Tue, Apr 14, 2015 at 11:35 AM OceanWolf notifications@github.com wrote:
|
@tacaswell No problem, just wondered when should we change the embedding examples? For example I now see we didn't convert https://github.com/matplotlib/matplotlib/blob/master/examples/user_interfaces/embedding_in_gtk3_panzoom.py during #3652. Anyway, from your comment I see whatever happens it won't get made default straight away, so that just leaves the question do we want to encourage people to switch early, i.e. by changing the embedding examples as the backends? Basically I see it as, without MEP22 the embed example for QT should get rewritten to follow the pattern (P.S. Definitely agree on getting all backends converted first, but for now I work on the assumption that we will get that done for the next point release) |
is this PR finished? are there outstanding issues? |
I agree with @mfitzp that the result is a bit ugly but it is certainly more usable than the status quo, and less ugly than getting "zoom rect" broken into two lines. |
@anntzer which option do you think we should use, do we need any changes to this PR? As I said above the whole toolbar will get a complete overhaul soon, so this will only act as a short-term fix for those using the current soon to become old toolbar... |
Keep in mind "soon" will likely be the next point release after 2.0. Which On Mon, Jul 13, 2015 at 4:16 PM, OceanWolf notifications@github.com wrote:
|
We should err on the side of short term fixes here. I suspect we are not On Mon, Jul 13, 2015, 4:16 PM OceanWolf notifications@github.com wrote:
|
I'll stick with the original PR, which is less ugly imho... |
Just had a thought. How does this look now with the new feature showing the image value on mouseover of an image? |
Kindly asking whether this should go to 1.5 as a short term fix (perhaps it's too late now?) or just be subsumed by MEP27 (feel free to close this and reopen a similar issue on MEP27's side if this is the case). |
I don't think we need to wait on MEP27 for this. Have you had a chance to investigate @WeatherGod's question?
|
With the old code, the x, y and image values are still cropped and half visible below the "pan/zoom" text. With the PR, the text can sometimes be too long to fit in a single line, depending on the width of the window (I guess it was already the issue before but it didn't appear with the default size used in the |
Thanks! |
Write status message in single line in Qt toolbar.
Write status message in single line in Qt toolbar.
Backported to v1.5.x as 50f373f |
Currently, the status message is partially hidden when embedding a
Toolbar in a Qt4 app (see e.g. embedding_in_qt4_wtoolbar.py: activate
the pan tool and hover the mouse over the figure; the two lines of the
status messages don't fit in the toolbar).
The split-line message was introduced in 3c61684 to avoid automatic
horizontal expansion of the toolbar in presence of long messages (I
guess) but I cannot reproduce that issue right now.