GNOME Bugzilla – Bug 82099
GtkImageMenuItem needs a style property or GtkSetting to toggle showing images.
Last modified: 2011-02-04 16:16:03 UTC
The GNOME option to not show images in menus does not affect GtkImageMenuItem and produces inconsistency unless all applications use the libgnomeui API and also override the GtkEntry and GtkTextView popup menus - and that causes bloat. I sincerely hope this can be done without breaking ABI, or, failing that, that the ABI can be changed.
Shouldn't this be a GtkSetting instead of a style property?
Ah, sorry, I hadn't thought of that. As long as we have consistency, it is good. Modifying the summary.
Related to this bug are these: #98077, #98589, and #98592.
Created attachment 18656 [details] [review] add gtk-show-menu-images and gtk-show-button-images settings and use them
Also see bug 78072 for a similar patch.
* The code needs to handle the setting changing on the fly * I think we are likely to break existing code if the child container heirarchy of the button is different with different values of this setting. It would be better to simply hide the GtkImage widget.
Created attachment 21468 [details] [review] new patch
Here is a new patch which doesn't change the hierarchy, only the visibility. It also handles changes on the fly and wires the settings as xsettings Gtk/ButtonImages and Gtk/MenuImages. The xsettings stuff was done for easier testing of changes on the fly with a patched xsettings-manager, and can be left out if you don't think it is needed.
Created attachment 21554 [details] [review] Better patch which installs the new widget-specific settings from the Installs widget-specific settings in class_init function rather than in gtksettings.c
Adding the PATCH keyword and marking priority as high.
Would it be possible to use gtk_widget_set_child_visible() instead of gtk_widget_hide()? That would make it robust against people calling gtk_widget_show_all() or gtk_widget_hide() on the parent widgets. Other than that the patch looks good to me.
Good idea. The patch predates set_child_visible()...
Also, should switch to P_() instead of _()
Actually, the right thing to use is not child_visible, but no_show_all.