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

Support high-DPI screens #111

Closed
binki opened this issue Feb 10, 2014 · 17 comments
Closed

Support high-DPI screens #111

binki opened this issue Feb 10, 2014 · 17 comments

Comments

@binki
Copy link

binki commented Feb 10, 2014

When viewing documentation in zeal, I cannot figure out how to zoom the documentation in. When reading the same documentation in mozilla versus zeal, I notice that zeal is rendering text with the assumption that my display’s resolution is 96DPI.

When mozilla launches, it reads in the system-wide DPI value and automatically scales its UI and all HTML appropriately. (It would be nice if it supported Windows 8.1 per-monitor DPI, but only IE supports that so far; for now I just restrict my use of mozilla to the monitor that happens to match Windows’s calculated system-wide DPI value).

When zeal launches, it calls SetProcessDPIAware(). This function is not to be confused with the newer/better API SetProcessDpiAwareness(); calling SetProcessDPIAware() is equivalent to calling SetProcessDpiAwareness(Process_System_DPI_Aware). (Ideally, you/qt will eventually support calling SetProcessDpiAwareness(Process_Per_Monitor_DPI_Aware).) (I am just assuming your application is calling the said function because its behavior is consistent with calling SetProcessDPIAware() and I can find that this method is referenced in platforms/qwindowsdll.) This means that if the user’s system DPI reflects a very high DPI, such as from a high density monitor (mine is only semi-high density at 120DPI), the users would see text at half-size or smaller and be unable to read it. I mean, if the screen is high density, the user could always use a real-life magnifying glass (and still not be able to see the pixels, isn’t it awesome? :-D) and be able to read the text fine, but this would be quite inconvenient.

As a stop-gap measure, adding in C-+ and C-- zoom (copying more functionality from web browsers) and later fixing your code to support Qt’s DPI support (I really hope that Qt and its webkit control support DPI if it’s calling SetProcessDPIAware() on your behalf) is really the only way to go. Maybe someday Qt will add support for Windows 8.1 per-monitor/dynamic DPI and, by using Qt’s current DPI APIs, your app will automamagically work with that?

@sidewinder94
Copy link

+1 for this one, my laptop's monitor is a 196 DPI one, and it can be quite tiring to read the docs at the original size.

If you cannot make the application DPI aware, a default zoom setting would be IMHO the best bet

@ionTea
Copy link

ionTea commented Jun 10, 2015

1+, I have a 4k display on 13.3-inches and for me zeal is unusable. Running Ubuntu 15.04 btw.

@trollixx
Copy link
Member

It should be possible to enable high DPI support in Qt starting with version 5.4. There's an article about that in Qt documentation. I don't have a high DPI device, so I have no idea how I could test it. Setting QT_DEVICE_PIXEL_RATIO environment variable to auto or specific value theoretically should do the trick. If someone could test whether setting QT_DEVICE_PIXEL_RATIO=auto works, then I would hard code that in Zeal.

It's also possible to set the minimum font size for the embedded web view in the Zeal settings.

@sidewinder94
Copy link

I can test that for you if you can provide me a compiled test version (Win 8 3200x1800 15.6")

@trollixx
Copy link
Member

@sidewinder94 CI builds should be the best option for testing.

@sidewinder94
Copy link

Well the, i tested the latest stable build (zeal-stable-0.1.1-9-gfd4f3e2-windows-x86.zip)
The interface was really better.
The default font size for the browser is still too small but thanks to the appearance tab in the options, it can be set at any value.

I would say the problem is solved for windows users :)

I don't have a HiDPI Linux available at the moment.

Here is a screenshot of what it looks like (i set the font size at 24 in the options):
capture

(the only minor problem left is the tab size, which are way too small for the text size)

@trollixx
Copy link
Member

@sidewinder94 Thanks for testing. Did you use QT_DEVICE_PIXEL_RATIO=auto or it worked out of the box?

I do see a problem with the tab bar. Tab maximum width is fixed in pixels, so this requires a fix.

@trollixx
Copy link
Member

As per font size in the web view issue, it should be possible to set text default/minimum size or scaling based on actual DPI. Additional info in QTBUG-29571 and this SO answer.

@sidewinder94
Copy link

@trollixx It worked out of the box.

@FichteFoll
Copy link

My DPI scaling is set to 1.25 and I didn't have problems with Zeal 0.1.1 (was displaying just fine). After I downloaded 0.1.1-82-g8a8544f, it rendered the window in the same way (except for margin-left on the seach list view and see also icons; but fonts where the same) and setting QT_DEVICE_PIXEL_RATIO=auto didn't do anything different either.

Since it was fine for me before I just assume that this issue never existed for me, but I wanted to mention it anyway.

Edit: I would upload images but it doesn't work for some reason.

@sven-mayer
Copy link

+1 I have the same problem, running Windows 8.1 with v0.1.1

Internal laptop screen 3200x1800 @ 13.3inch ( 276.05 PPI) its scaled 150%: but is is presented with 100%, so really tiny:
ppi276

its necessary to have the scaling dependent on the actual monitor. cos often external laptop screens have different DIP scaling.
This happens on my external scaled 100% screen (1920x1080 @ 24inch):
external

@trollixx
Copy link
Member

I wonder if anyone still experiencing any issues with Zeal on HiDPI screens? Qt should behave quite well nowadays.

@kjaquier
Copy link

kjaquier commented Nov 1, 2016

Hi. Just discovered and installed Zeal to try out. I also have a display issue on Ubuntu 16.04 with my Dell XPS 13 9350 (3200x1800px with Unity scale set to 2x). I try upgrading to the updated version from the PPA but the issue remains.
capture du 2016-11-01 15-49-05
Changing minimal font size is enough for most docs but not all of them (jquery's is totally messed up for instance).

@robotlovesyou
Copy link

@kjaquier Starting zeal using the QT_DEVICE_PIXEL_RATIO=auto environment variable as described further up this thread addresses this issue

@kjaquier
Copy link

@robotlovesyou Thanks. I tried it and it works great.
Though, I had to use QT_DEVICE_PIXEL_RATIO=2 instead of auto, because for some reason auto makes everything too big.

@trollixx trollixx added this to the 0.4.0 milestone Jan 31, 2017
@trollixx trollixx changed the title Support Windows DPI at least as well as Mozilla does. Support high-DPI screens Feb 19, 2017
@trollixx
Copy link
Member

The change committed requires Qt 5.6+ to work, our CI is currently building with Qt 5.5.1. I am working on fixing that.

@lock
Copy link

lock bot commented Sep 16, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Sep 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

8 participants