Unusable on 4k/hidpi monitors due to hard-coded icon sizes

I use a 4k display and I like to have big icon sizes in Qt/KDE toolbars in my programs.

I tried shotcut briefly and it’s just unusable with it’s extremely tiny (on my screen) icons. Qt applications in general are fine because the icons scale either according to KDEs settings in KDE or qt5ct in other desktop environments. But that does not work in shotcut.

A brief look as to Why, what is Shotcut’s problem - it’s a Qt application after all, it should work, revealed that you’ve actually hard-coded tiny icon sizes into the xml files. Why would you do this? I have no idea. I encourage you to please stop.

To test how it’s fixed, I did a quick test of /usr/share/shotcut/qml/timeline/TimelineToolbar.qml and simply replaced “implicitWidth: 28” and “implicitHeight: 24” with nothing (removed all instances). This made Qt use appropriate icons-sizes.

You should probably remove all the tiny hard-coded icon sizes. I guess I could go through the program and fix it but I’ll just stick with kdenlive

1 Like

Why would you do this?

It is a cosmetic tweak, especially for HiDPI. Without it, regardless of HiDPI, the icons fill the toolbar with no padding and are more spaced. Without it, on Windows and Linux with HiDPI, the icons will overrun the bottom edge of the toolbar. It looks good on macOS and Windows with high res monitors in HiDPI modes but not so great with Linux (Ubuntu 18.04 with GNOME Shell in my test). In general, my Qt apps on Linux look bad in HiDPI mode (200% on UHD monitor). See my screenshot:

Maybe that can improved in Tweaks.

Here is Shotcut after making the change you suggest to only the Timeline toolbar:

Yes, the timeline toolbar icons are bigger now, but it has not helped the main toolbar where we have not specified icon sizes (see also Kdenlive’s main toolbar icons). Rather, now it is inconsistent and the line that forms the bottom of the toolbar is running behind and through all of the icons (this is with an explicit ToolBar height in the QML removed). I do not choose to sacrifice the experience of the 99% to improve the already poor experience of the 1%.

Here is how the current version (19.02) looks good on Windows with a UHD monitor running at 200% density.

Here is how the current version (19.02) looks good on macOS with 2560x1600 Retina screen in HiDPI mode:

Actually, I found in the where I had set the main toolbar icon size to 16x16. Removing that and a few tweaks improves things:

Text size cause some issues, and I made some adjustments for that. Changing the font scale to 0.95 in GNOME Tweaks makes the font size much smaller in Qt, which helps but looks odd and defeats the purpose of 200% density. There are still problems such that some icons are supposed to be smaller than normal (e.g. in track heads and Preset +/-). Those do not adjust themselves. Some sizes in our custom Quick Controls must be multiplied by 2. Leaving out their size makes them not show at all or look very wrong. This means I would have to make many size values multiplied by devicePixelRatio but for Linux only. This is not supposed to be required for Quick. The sizes in Quick are supposed to scale automatically. It should be noted that none of these changes are needed for HiDPI on macOS and Windows. There would still much work and tweaking to be done all over the place especially to deal with the text size - again, only needed on Linux. It’s just not worth my time making a bunch of cosmetic workarounds for HiDPI on Linux. Some of these changes are probably safe to commit without drastically altering the experience on macOS and Windows. However, other things not unfortunately.

The changes safe regardless of OS were committed for the next release:

I never had problems with Shotcut’s HiDPI scaling and my 3840x2160 display (QT_SCREEN_SCALE_FACTORS=2) under KDE.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.