Skip to content

Fix NavigationToolbar2QT height #14697

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

Merged

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Jul 4, 2019

PR Summary

Fixes #10891. See also #14518.

Before:

grafik

After:
grafik

Note

This and #14518 only change the behavior for non-HiDPI screens.
I'm wondering if the distinction is still necessary. I would assume that Qt should handle this out of the box without manual tuning.

@anntzer
Copy link
Contributor

anntzer commented Jul 5, 2019

I don't have a real high-dpi display available but you can fake one by setting QT_SCALE_FACTOR (e.g. to 2); based on that I think we could perhaps even just delete both

        # Esthetic adjustments - we need to set these explicitly in PyQt5
        # otherwise the layout looks different - but we don't want to set it if
        # not using HiDPI icons otherwise they look worse than before.
        if is_pyqt5() and self.canvas._dpi_ratio > 1:
            self.setIconSize(QtCore.QSize(24, 24))
            self.layout().setSpacing(12)

(in _init_toolbar) and the whole sizeHint (just relying on the base class implementation), instead of doing any special handling for high dpi...

@anntzer anntzer added the GUI: Qt label Jul 5, 2019
Copy link
Contributor

@anntzer anntzer left a comment

Choose a reason for hiding this comment

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

approving as clearly an improvement, but perhaps we can do even better per the comment above?

@tacaswell tacaswell added this to the v3.1.2 milestone Jul 5, 2019
@tacaswell
Copy link
Member

Merging this as it makes things better and defer a bigger overhaul to a follow on.

To be consistent with #14518 this should be backported, where as I would prefer to not backport a PR with @anntzer 's suggestions.

@tacaswell tacaswell merged commit dcff0d2 into matplotlib:master Jul 5, 2019
@timhoffm timhoffm deleted the fix-qt5-navigationtoolbar-size branch July 5, 2019 16:32
@anntzer
Copy link
Contributor

anntzer commented Jul 5, 2019

No worries, I made #14702 :)

@QuLogic
Copy link
Member

QuLogic commented Jul 17, 2019

@meeseeksdev backport to v3.1.x

meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jul 17, 2019
timhoffm added a commit that referenced this pull request Jul 17, 2019
…697-on-v3.1.x

Backport PR #14697 on branch v3.1.x (Fix NavigationToolbar2QT height)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Toolbar icons too large in PyQt5 (Qt5Agg backend)
4 participants