-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[bugfix][hidpi] Scalable SVG theme cursors #5737
Conversation
Add support for SVG cursor: ZoomIn, ZoomOut, Identify, CrossHair, CapturePoint, Select, Sampler, Icons are provisional: they need some love from a decent graphics designer. Fixes qgis#12671
3e4ada2
to
7ae8e16
Compare
This should work well on different DPI screens. Still needs some testing on the various platforms.
This is a big improvement on my hi dpi screen! I think we should merge and then update the cursor graphics. Oddly, I've noticed that the Qt OpenHandCursor/ClosedHandCursor cursors are tiny too, even though other Qt cursors work fine. Maybe we should provide svg versions of these too? |
@SrNetoChan what do you think? Do you have some better icons yet? |
Thanks Alexandre Neto!
@SrNetoChan I've added your icons, they look good!! |
@nyalldawson the "hand" icons on KDE are perfect but I guess that with cursors the look and feel actually changes from one platform to another, from one version to another and from one desktop manager to another 😞 |
@elpaso I am currently checking how they look in "non-hidpi" screens. In my manual tests, the halo looks a bit pixelated because of pixmap interpolation. But I was using 24x24 size. |
Here's the all cursors. Please overwrite the mSampler.svg and mIdentify.svg as well because I have run svg_cleaner on them. Regarding the active points (assuming 32x32): ZoomIn (13,13) I can confirm that in non-hidpi, the cursors looks very small and pixelated. could we bump them to 24x24? The halo still looks a bit strange so I have avoided it as much as I could. |
Cursors are now approximately 24x24 pixels on 96dpi
@SrNetoChan it's getting better and better. Let me know how it looks like at 96dpi |
Definitely much better now on non-hidpi. On hidpi screens can you notice that the sampler allows to see the color that it is picking? |
BTW, there is still a issue with the sampler cursor when using the color picker for the layer styling dock. It is replaced by the default arrow as soon as you move the mouse. This doesn't happen using the color picker from the color selection dialog. |
@SrNetoChan for what it worths the sampler from the styling dock is already broken in current master. |
@SrNetoChan I couldn't fix the issue with the styling dock but at least it was not introduced by this PR so I don't see it a good reason for not merging. (btw, when the window is not maximized and the menu drops out of the main window the issue is not there). |
@elpaso interesting. I will see if there is a bug report about that. Otherwise I will create one. |
@elpaso FYI https://issues.qgis.org/issues/17597 This is probably something for @NathanW2 or @nyalldawson |
Let's give this a try. We need some feed-back from different platforms/DMs/screen sizes. |
@m-kuhn they already are scalable (and scaled), we could either have a better logic to define the size or make it user-configurable. Besides, I've found no way to get the cursor size from the O.S., that would be my preferred way to get the right size. Unfortunately the cursors size depends not only on the dpi but also on the platform, the desktop manager and the cursor theme one is using. See the logic here: https://github.com/qgis/QGIS/pull/5737/files#diff-e46a31dc04eb1c0d7bf46ed726e5e6f3R539 I see I forgot to apply It would be useful if you could check if appying the factor (on win) does a better job. |
I do not have a windows system but if you can tell me what I can fine-tune, I'll be happy to check |
@m-kuhn (and @rduivenvoorde, @SrNetoChan) As @nyalldawson explained to me, on windows the fontMetrics should be corrected by multiplying the value with A quick test in python to see what looks like on different platforms is:
|
Without the |
@dakcarto how does that look like on (retina?) Mac? |
@m-kuhn without the 1.5 it looks 1.5 times smaller than the standard cursor theme on my KDE 😄 |
Let's wait for the feedbacks and go for a simple KDE switch in case that's adequate ;) |
Actually... didn't KDE always ship with oversized cursors? |
I can confirm without the 1.5 multiplier the cursors look reasonably on my hidpi screen. By the way, I am using KDE. Maybe the cursor size should not be derived from font size, but rather from "normal" cursor size somehow? |
On Gnome/Debian NON-hidp,i I like the cursors best without the 1.5 The current normal cursor is a little too heavy to me currently. Something else I see: the normal (Gnome)-cursors have a little white halo around it, which makes it a little less 'flat'. Is that an idea? Or are those 'old-fashioned' or so? |
@wonder-sk I tried but I didn't find a way to get the size of the O.S. cursor... do you have any idea? If do everybody agree we can add a user option for the multiplier (something like "tiny", "small", "normal", "big", "huge"), where 1 is "normal" and range from 0.5 to 2 |
@elpaso are you sure? This is what I have now: |
@rduivenvoorde the zoom-in/out has a white interior instead of the white exterior halo (same effect of being visible on a dark bg), other cursors that do not have an "interior" have the white exterior (halo), but @SrNetoChan knows better than me. |
@rduivenvoorde I tried to avoid the white halo as much as I could. So I only used it in completely black cursors. The problem with that, is that for resizing the SVGs and converting it to pixels there is some kind of interpolation, that transforms the pure white in gray variations and it does not look very sharp in the end. I can remove the halo, but if you move your cursor over a full black background, it will disappear. |
@SrNetoChan ah, thanks. Sorry for my critics then, I see there is already a lot of thoughts and time in it... |
There might be another way of doin |
Add support for SVG cursors:
Icons are provisional: they need some love from
a decent graphics designer.
Fixes #12671