GTK3: No icons in menus

Bug #1636493 reported by Michael Soluyanov
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Unassigned

Bug Description

There is no icons in menus in inkscape dev version.

I have Ubuntu 16.04.1 LTS, GNOME Shell 3.18.5, Inkscape 0.92+devel (Oct 24 2016)

I tryed this settings:

gsettings set org.gnome.desktop.interface menus-have-icons true
gsettings set org.gnome.desktop.interface buttons-have-icons true
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/ButtonImages': <1>, 'Gtk/MenuImages': <1>}"

but it does not work.

I also tryed launch with

UBUNTU_MENUPROXY=0 inkscape

but it does not work too

Tags: gtk3 ui
Revision history for this message
Michael Soluyanov (crantisz) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Underlying issue exposed in GTK3-based trunk with the broken fork of code for menu icons with GTK3-based builds tracked in earlier report (see comment #7):
* Bug #1264719 “GTK3 : Invalid rectangle passed in pixman_region32_init_rect”
  https://bugs.launchpad.net/inkscape/+bug/1264719

tags: added: gtk3 ui
Revision history for this message
su_v (suv-lp) wrote :

Inkscape's forked code for menu icons with GTK3 builds is broken (icons are not rendered visibly; pixman errors are logged on console with more recent versions of dependencies, see bug #1264719).

summary: - No icons in menus
+ GTK3: No icons in menus
Changed in inkscape:
status: New → Confirmed
Revision history for this message
Michael Soluyanov (crantisz) wrote :

Inkscape outputs on startup:
Warning: Font face with same CSS values already added: Proxima Nova Normal (Regular, Regular)
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

Revision history for this message
jazzynico (jazzynico) wrote :

Also reproduced on Xubuntu 16.04, lp:inkscape rev. 15196.

Changed in inkscape:
importance: Undecided → High
milestone: none → 0.93
status: Confirmed → Triaged
Revision history for this message
su_v (suv-lp) wrote :

Upstream has removed support for icons in menus in GTK+ 3.x. The fork of the menu icon code in Inkscape trunk (GTK3) was reverted (removed) in
https://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/15368

Revision history for this message
Patrick Storz (ede123) wrote :

Can't we just stick with gtk2 :-X
I don't like what people are doing to GUIs these days...

I'd certainly vote for having icons back.

Revision history for this message
Mike Kowalski (mike-kov) wrote :

I built Inkscape from sources today and I was pleasantly surprised how clean main menu is... until I discovered this "bug".
Please take a look at those menu icons in 0.92 and try to judge if they bring any value. With the exception of path operations (union, diff, etc.) they are just visual noise IMHO. Removing this clutter results in improved UI.
Please reconsider fixing this "bug".

Revision history for this message
Martin Owens (doctormo) wrote :

One man's noise is another man's critical and crucial user interface. I think there's some good UX research on the topic of graphical notation for menus, but I don't have any pertinent links.

I honestly think the icons might fall away in the coming years with menu re-factoring. Having menus that can be configured and customised is a desired feature and reducing code is always a plus. But I think it'll come with some other change rather than someone coding this specifically.

Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Playing devil's advocate: menus themselves are quite old fashioned from a UX perspective...

Maybe things like Boolean ops would be better placed in context-sensitive UI (with icons), rather than being hidden in a menu?

Revision history for this message
Patrick Storz (ede123) wrote :

That might be true, but Inkscape has *a lot* of features and it might well be impossible to squeeze them all into one of these modern ribbon-style toolbars (that's what you have in mind if I'm not mistaken).

Unless we win a developer with a lot of free time who is great with not only styling UI but also implementing it (doubtful) or better yet a group of developers with these attributes who can efficiently collaborate (even more doubtful) we might be off significantly better with sticking to UI that might be called "old fashioned" but at the very least is known to work!

Having menus and icons is maybe not a perfect way to design UI, but it allows to achieve structure and usability without too much development effort.

Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

From the GTK3 documentation:

https://developer.gnome.org/gtk3/stable/GtkImageMenuItem.html

Note that the user may disable display of menu icons using the “gtk-menu-images” setting, so make sure to still fill in the text label. If you want to ensure that your menu items show an icon you are strongly encouraged to use a GtkMenuItem with a GtkImage instead.

GtkImageMenuItem has been deprecated since GTK+ 3.10. If you want to display an icon in a menu item, you should use GtkMenuItem and pack a GtkBox with a GtkImage and a GtkLabel instead. You should also consider using GtkBuilder and the XML GMenu description for creating menus, by following the GMenu guide. You should consider using icons in menu items only sparingly, and for "objects" (or "nouns") elements only, like bookmarks, files, and links; "actions" (or "verbs") should not have icons.

Furthermore, if you would like to display keyboard accelerator, you must pack the accel label into the box using gtk_box_pack_end() and align the label, otherwise the accelerator will not display correctly. The following code snippet adds a keyboard accelerator to the menu item, with a key binding of Ctrl+M:

GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
GtkWidget *icon = gtk_image_new_from_icon_name ("folder-music-symbolic", GTK_ICON_SIZE_MENU);
GtkWidget *label = gtk_accel_label_new ("Music");
GtkWidget *menu_item = gtk_menu_item_new ();
GtkAccelGroup *accel_group = gtk_accel_group_new ();

gtk_container_add (GTK_CONTAINER (box), icon);

gtk_label_set_use_underline (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);

gtk_widget_add_accelerator (menu_item, "activate", accel_group,
                            GDK_KEY_m, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (label), menu_item);

gtk_box_pack_end (GTK_BOX (box), label, TRUE, TRUE, 0);

gtk_container_add (GTK_CONTAINER (menu_item), box);

gtk_widget_show_all (menu_item);

Revision history for this message
Alberto Simoes (asimoes) wrote :

I can confirm this behavior in 1:0.91.0+devel+15038+76~ubuntu16.04.1 under Mint. In fact, icons are there, but cropped.

Given a comment above asking to stick to Gtk2, I would be happy to say to do that, IF 4K displays were supported on it. Working with small-icons inkscape is too tiresome.

Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

Inkscape trunk can show icons in menus on an icon-by-icon basis by editing menus.xml. Current trunk has the Path operation icons enabled.

git commit 18c0d1

Changed in inkscape:
status: Triaged → Fix Committed
Revision history for this message
Patrick Storz (ede123) wrote :

Shouldn't we leave this open?
- The fact that there is a *possibility* to add icons does not solve
  this issue yet - somebody has to actually add them!
- Also I think Martin mentioned issues in the current implentation
  that still need to be fixed. (Menu breaks down on some flavor of
  Linux if I remember correctly)
- From an UI point of view there was also still room for improvement,
  unfortunately we never finished that discussion...
  I had the impression the current implementation was lacking,
  and not generally favored (I certainly don't).

[1] https://sourceforge.net/p/inkscape/mailman/inkscape-devel/thread/CAH3Si3Oim_7is3SZh%2BjWhxQt21-Nbp8k6%3DHbTpvTPkutDo8CUw%40mail.gmail.com/#msg35933306

Revision history for this message
Matheus Marinho (mrnhmath) wrote :

This GTK regression affects so many applications, hope they'll reconsider an undeprecation.

Revision history for this message
Imerion (imerion) wrote :

"One man's noise is another man's critical and crucial user interface."

Agreed. It's really surprising how much faster I find the correct menu option, even in applications I've used a lot, when there is a bit of color or a few simple shapes to go by. It also helps dyslexic people and those with visual disabilities to easier find the right option. Please don't remove them!

Revision history for this message
Patrick Storz (ede123) wrote :

I was actually working on this the last few days and will submit an MR soon.

Current idea is to add an option to either
a) enable all icons or
b) disable all icons or
c) let the theme decide

I intend to make c) the default and reduce the default amount of icons considerably (as there are a lot of them and many are really not that useful) but also increase the amount considerably compared to the "fix" in current master.

Revision history for this message
Imerion (imerion) wrote :

Excellent! That is indeed good news and I very much appreciate that you take the time to implement an option for this. For me, more has always been better in this case, so it's great to know that will be possible. But having alternative c) as standard sounds reasonable.

Just out of curiosity, will the code enabling this be possible to use for other applications too without too much effort? That is, could other projects being ported to GTK3 where this is imporant, such as GIMP, make use of the same code?

Max Gaukler (mgmax)
Changed in inkscape:
status: Fix Committed → Fix Released
Revision history for this message
Stephane Lorrain (hellwoodfire) wrote :

Please Tweet:
@GTKtoolkit Please Un-deprecate GtkImageMenuItem. We WANT icons in our menus. (LibreOffice, Inkscape, Gimp...)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.