After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 742907 - [PATCH] GMenuModel submenu icons
[PATCH] GMenuModel submenu icons
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkMenu
3.14.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-01-14 11:29 UTC by ria.freelander
Modified: 2018-05-02 16:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Submenu icons patch gmenumodel (489 bytes, patch)
2015-01-14 11:29 UTC, ria.freelander
none Details | Review
Example of icons in submenus via this patch. (46.42 KB, image/png)
2015-01-15 09:01 UTC, ria.freelander
  Details
Another example of possible usage of submenu icons. (43.09 KB, image/png)
2015-01-15 10:46 UTC, ria.freelander
  Details
Simple example of different menumodel rendering in menus and popovers (2.05 KB, text/x-csrc)
2015-01-17 18:11 UTC, ria.freelander
  Details

Description ria.freelander 2015-01-14 11:29:28 UTC
Created attachment 294510 [details] [review]
Submenu icons patch gmenumodel

I create a 1-line patch that cause GtkMenuShell submenus to reflect GMenuModel icon property. Can it be merged?

I think GMenuModel submenus is not sections and it can be nouns.
Comment 1 Matthias Clasen 2015-01-14 18:34:23 UTC
not in favour of that. icons on submenus are unusual.
Comment 2 ria.freelander 2015-01-15 08:59:24 UTC
Icons in submenus can be used for:
1. Implementation of system menu (main menu)
2. Implementation of window list
3. Implementation of user changeable menu.

What cons against it?
Comment 3 ria.freelander 2015-01-15 09:01:13 UTC
Created attachment 294577 [details]
Example of icons in submenus via this patch.
Comment 4 Emmanuele Bassi (:ebassi) 2015-01-15 10:13:29 UTC
(In reply to comment #3)
> Created an attachment (id=294577) [details]
> Example of icons in submenus via this patch.

you may have noticed that we don't do that kind of menu any more…

(In reply to comment #2)
> Icons in submenus can be used for:
> 1. Implementation of system menu (main menu)
> 2. Implementation of window list
> 3. Implementation of user changeable menu.
> 
> What cons against it?

you listed three scenarios that we actively avoid, these days.
Comment 5 ria.freelander 2015-01-15 10:22:31 UTC
(In reply to comment #4)
> you may have noticed that we don't do that kind of menu any more…

This is from my LXPanel fork.

> you listed three scenarios that we actively avoid, these days.

I know, that you want to avoid these scenarios for GNOME, but for other GTK desktop environments (MATE, for example, or XFCE) it is valid usecases for GtkMenu. 

I think possibility for doing this should be remain from GtkImageMenuItem.

Or, at least, if you actively con against this kind of menus, note it in docs (not in GNOME HIG, but in GTK+ docs, for non-GNOME GTK developers). For me it was a badly surprise...
Comment 6 ria.freelander 2015-01-15 10:46:52 UTC
Created attachment 294587 [details]
Another example of possible usage of submenu icons.

New from template submenu. It is rare, but possible.
Comment 7 ria.freelander 2015-01-17 12:54:52 UTC
Next example: Paste as menu. Examples of this menu can be found in LibreOffice. And it is good to have it with edit-paste icon.
Comment 8 ria.freelander 2015-01-17 17:29:48 UTC
Ok, another reason. Popovers can have icons in submenu headers.

In gtkmenusectionbox, line 408 we can see:
  g_object_bind_property (item, "icon", button, "icon", G_BINDING_SYNC_CREATE);

Then menu and popover with same model will be different, which is not good, I think. I will provide an example screenshot soon.
Comment 9 ria.freelander 2015-01-17 18:11:27 UTC
Created attachment 294748 [details]
Simple example of different menumodel rendering in menus and popovers

Same model is rendered differently, when attached to menu and to popover.
Comment 10 ria.freelander 2015-01-18 21:08:13 UTC
Another possible usage of submenu icons - reimplementing Gnome Shell application menu via GtkMenuBar.
Comment 11 GNOME Infrastructure Team 2018-05-02 16:22:05 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/525.