Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2092)

Unified Diff: chrome/common/gtk_util.cc

Issue 199099: GTK: Set the back/forward and bookmark bar menus to always show their images.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: commentary Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/gtk_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/gtk_util.cc
===================================================================
--- chrome/common/gtk_util.cc (revision 26017)
+++ chrome/common/gtk_util.cc (working copy)
@@ -474,4 +474,25 @@
return average_color;
}
+void SetAlwaysShowImage(GtkWidget* image_menu_item) {
+ // Compile time check: if it's available, just use the API.
+ // GTK_CHECK_VERSION is TRUE if the passed version is compatible.
+#if GTK_CHECK_VERSION(2, 16, 1)
+ gtk_image_menu_item_set_always_show_image(
+ GTK_IMAGE_MENU_ITEM(image_menu_item), TRUE);
+#else
+ // Run time check: if the API is not available, set the property manually.
+ // This will still only work with GTK 2.16+ as the property doesn't exist
+ // in earlier versions.
+ // gtk_check_version() returns NULL if the passed version is compatible.
+ if (!gtk_check_version(2, 16, 1)) {
+ GValue true_value = { 0 };
+ g_value_init(&true_value, G_TYPE_BOOLEAN);
+ g_value_set_boolean(&true_value, TRUE);
+ g_object_set_property(G_OBJECT(image_menu_item), "always-show-image",
+ &true_value);
+ }
+#endif
+}
+
} // namespace gtk_util
« no previous file with comments | « chrome/common/gtk_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698