You are not logged in.

#1 Today 12:53:25

itsfarseen
Member
Registered: 2021-11-20
Posts: 2

Suggestions for HiDPI page - Gtk3 fractional scaling without GDK_SCALE

I was revisiting proper HiDPI setup on X after a fresh install of linux on my laptop.

> Under GTK3/4 it not currently possible to scale icon sizes, unless the application explicitly implements a way to do so. See bug report #4528. If you need this feature, use Qt when possible.

This is incorrect.

I found that he only thing that's stopping Gtk 3 themes from having properly scaled UI elements as per Xft/DPI xsettings key, is that the themes use px instead of rem.

I found that this theme scales nicely: https://github.com/paullinuxthemer/Nextwaita/

So I wrote a python script (with the help of ChatGPT): https://gist.github.com/itsfarseen/f8f7 … 66e907dccc
This reads ~/.local/share/themes/<theme> and produces ~/.local/share/themes/<theme>-<px>px
Where <px> = 1 rem.

EDIT: forgot to add the script usage.
python3 script.py /path/to/theme N
I've found that a value of 13-14 works nice. Making N smaller makes the UI elements larger relative to the text, and vice versa.

The new theme is fully scalable and doesn't display distortion like padding/context menu is too small while text is too big.

I have only tested this with Gtk 3 on X11.

This also makes it safe to use GDK_SCALE=2 GDK_DPI_SCALE=0.5 as a no-op on properly themed configs, and a decent fallback on other setups.

PS: I'm new here, how do I get email notifications for replies here? Is that enabled by default or do I need to configure it somewhere?

Last edited by itsfarseen (Today 12:54:59)

Offline

#2 Today 17:39:54

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,304

Re: Suggestions for HiDPI page - Gtk3 fractional scaling without GDK_SCALE

You probably want to open a discussion on the talk page with this, that way active wiki contributors can chime in, or if you feel you can do the edit without reorganizing too much you could also "just do it"

For the notification question, there's a  "Subscribe to this topic" button under the topic box, as well as the option to enable auto subscribe to topics you post in your Profile -> Privacy settings.

Offline

Board footer

Powered by FluxBB