feature request: PopoverMenu/GMenuItem should have a property/attribute to force always showing icon(s)
See below discussion from IRC. Currently GTK only really shows icons if a horizontal, icon-only display-hint
is set; otherwise it's very resistant to showing icons, including in the traditional case of vertical items.
We need this in Inkscape for our main right-click context menu - and so, for now, have had to go spelunking through the widget tree and force-show the icons that, luckily, GTK still creates. The alternative would be to reimplement the entire GMenu/action/PopoverMenu ecosystem, which... no thanks
If there was a way to force either individual GMenuItems or at least an entire PopoverMenu to always show their icon(s), including in the majority of cases which currently do not - that would be much appreciated!
so I'm hoping this can be accepted as a valid feature. If so, I should be able to try implementing it, once we have an idea where/how we want the new 'setting' added.
Company
yea
I would caution though: GTK4 did not get too much work done on menus
so there might be valid reasons to improve things for apps that use menus extensively
dboles
so the way that popover menus behave there might not be the ideal design, i guess
mclasen
they were made to be 'close enough' to menus
Company
and if you encounter such things, talking to mclasen (who did the popovermenu stuff) about adding improvements in GTK is probably a good idea
mclasen
not more, not less
dboles
well, here's one...
the immense resistence of popover menus to showing icons except in a few, inline, icon-only cases - is a big problem for us
to the extent that i had to add a function to walk the widget tree and force-show the icons that, luckily, GTK creates but does not show
so an attribute like 'really-show-icon-please' would be great...
as of course you are free to say 'that shouldnt be possible' and stop ever creating/adding those widgets in future, so i don't want to rely on tricking GTK into showing them
this was for our right-click context menu, primarily
the only other option i could see was to stop using GMenu/actions and go to a fully manual approach - where we can pack whatever widgets we want - but then i'd have to reinvent so many wheels (submenus, keynav, etc.)
mclasen
any major problems with the rest of the menu functionality ?
dboles
not that i've noticed yet :-) but i've not reached the main menu yet... lol. i especially like the nested submenus in GTK4
[...]
dboles
shall i make an issue requesting adding scrolling? and any thoughts on a way to always show icons?
mclasen
dboles: if adding a scrolledwindow in the right place makes big menus usable without affecting menus of the right size, I'm fine with it
for always showing icons, i would have to review what conditions we currently use for it
dboles
iirc it's only if one of the display-hint values are set, then the items are displayed as horizontal sets of icons only, no labels
but we want to show the items normally, vertically, with icons and labels