Skip to content
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

Add delegate support for dpi scaling Fix #93 #112

Merged
merged 3 commits into from
Nov 13, 2020

Conversation

chadmv
Copy link
Contributor

@chadmv chadmv commented Oct 30, 2020

Updated the delegates to support dpi scaling. Only tested on Windows.

@chadmv chadmv changed the title Add delegate support for dpi scaling Add delegate support for dpi scaling Fix #93 Oct 30, 2020
@@ -1062,3 +1066,9 @@ def heads_up(self, title, message, command=None):

# TODO(marcus): Implement this.
self.info(message)

def paintEvent(self, event):
scale = self.windowHandle().screen().logicalDotsPerInch() / 96.0
Copy link
Member

Choose a reason for hiding this comment

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

Interesting!

@mottosso
Copy link
Member

mottosso commented Oct 30, 2020

Nice one Chad, happy to merge this once you're happy and preferably tested on a Linux flavour. Alternatively, put the use of the feature behind a os.name flag to only support Windows.

Would you mind incrementing the version as well? Then I can make a new release to PyPI right away.

@mottosso
Copy link
Member

mottosso commented Nov 6, 2020

Hm, I think this only works with Qt 5, as QScreen was only introduced by then. So we'd also need a flag for anyone using Qt 4 (e.g. Maya 2016 and below)

@mottosso
Copy link
Member

All that's needed for this one is an if statement to limit the behavior to Qt 5 and Windows. From there, the adventurous developer could unravel those limitations one-by-one until we've eventually got support for it all.

chadmv and others added 2 commits November 12, 2020 13:46
Limit scaling adjustment to Qt5 and Windows since only tested in Windows
@mottosso
Copy link
Member

Woho! 🥳

@mottosso mottosso merged commit 5f8eacf into pyblish:master Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants