~scoopta/wofi#179: 
GTK icons don't scale on HiDPI

We don't have a way to resize the GTK icons of the form.

Having an option to do so, or reuse the existing "image size" option would be neat.

Currently it looks like this on 4K (see input magnifier). https://x0.at/1Qwa.png

It also affects the "delete" button on the right side of the text input.

Status
REPORTED
Submitter
~zeioth
Assigned to
No-one
Submitted
2 years ago
Updated
2 years ago
Labels
No labels applied.

~zeioth 2 years ago*

Right... This took me a long time to figure out because I'm no C expert, but I've been reading the source code and now I understand we are creating a gtk searchbar with the css selector name 'input' (wofi.c, line 1767).

Having that info is easy to figure out one can just

#input * {
  background-color: red;
  color: red;
}

To apply styles to the searchbar icons.

~zeioth 2 years ago*

I've succeeded. This is how I've adapted wofi for HiDPI:

It seems one cannot use the selector from the official docs (searchbar → revealer → box...) but the structure still exists, and can be accessed through child selectors.

/* search icon */
#input:first-child > :nth-child(1) {
  min-height: 1.25em;
  min-width: 1.25em;
  background-image: -gtk-icontheme('open-menu-symbolic');
}

/* clear icon */
#input:first-child > :nth-child(4){
  min-height: 1.25em;
  min-width: 1.25em;
  background-image: -gtk-icontheme('window-close-symbolic');
}

Of course the original icons are still there under the background image. GTK HiDPI support is hideous atm.

~scoopta 2 years ago

There are a lot of items that don't have explicit selectors in wofi, and are therefore undocumented, however, as you noticed this doesn't mean they don't exist. ANYTHING in GTK can be selected if you know how to do it. Usually I recommend people set GTK_DEBUG=interactive when launching wofi as this can be used to inspect the widget hierarchy.

~zeioth 2 years ago

Hey thank you. You can see the difference here.

I'm triying to get some traction on this issue on GTK.

~scoopta 2 years ago

I looked at your issue...and you're right about GTK having some philosophical issues with this...and other things. I wanted to port wofi to GTK 4 but they removed an API I need for it...and the reception to a bug report for it didn't go well. I've basically given up on it. Personally I can't stand QT because I hate C++(C FTW) and IMO GTK just looks better visually...but man do the gnome devs have an apple like mentality which drives me batty most days.

~zeioth 2 years ago*

I think the same, but I recently discovered that making QT look like GTK is actually trivial.

Anyway, wofi is awesome like it is. No need to do anything radical. GTK will eventually catch up, and everything will be fine, I hope.

Also this is unrelated but I think there are QT/GTK hooks for rust. That's going to be a cool experiment for someone in the future 😁

~zeioth referenced this from #196 9 months ago

Register here or Log in to comment, or comment via email.