Gtk4 Icon in GtkHeaderbar is very tiny for 27 inch 4k display

I try to add some more GtkMenuButtons to the GtkHeaderbar of GitHub - StefanSalewski/SDT: A simple Nim GTK4 drawing and design tool.

But icons set with menuButton.setIconName(“accessories-text-editor”) are very small so that the more complicated icons with some detailed structure can not be recognized.

I followed basically the example from GTK4 for Graphical User Interfaces.

In that example the icon name “open-menu-symbolic” is used, which has not many details, so tiny size is not a problem. But as you can see in that example the image is much smaller than the button. So there would be room for a larger image.

I tried for much more than an hour to find a solution, but failed. My SDT app has already an Image widget and an UTF label in the headerbar. For the Image I used worldImage.setIconSize(IconSize.large) to make it a bit larger, and for the UTF-8 Grid symbol I used pango markup with gridLabel.setMarkup(“\u{25A6}”). But for the GtkMenuButton thre seems to be no way to avoid the tiny size.

This is for a recent GTK4 version build from git sources for Linux.

The new API docs tell us: Gtk.MenuButton.new

You can replace the child widget with another GtkWidget should you wish to.

But that seems not to be easy.

A lot of icons, incl. this one, have been redrawn for 41 and are much larger:

Screenshot from 2021-08-04 21-44-37

1 Like

Sounds good. But why redrawn, I thought it was SVG which could scale?

With 41 you refer to the next Gnome Shell version? I use Gnome 40 shipped with my Gentoo Linux, but installed GTK4 on /opt from git sources recently. But maybe the icons are still delivered by the Gnome 40 shell – yes would make sense. OK, then I just have to wait, thanks.

41 is not yet released, yes. The icons are in GTK4, in adwaita-icon-theme and in apps themselves, gnome-shell doesn’t have much to do with any of this.

Why redrawn - well, you can imagine scaling a pixel-aligned icon by a fractional amount won’t produce any good results. :slight_smile: The pixel alignment would be non-existent, line widths would be all over the place instead of consistent 2px, the proportions would be all wrong.

Some icons have changed pretty significantly so they fill the space better, for example:

Screenshot from 2021-08-04 22-07-51Screenshot from 2021-08-04 22-07-54

1 Like

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