summaryrefslogtreecommitdiffstats
path: root/chrome/common/gtk_util.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 21:08:41 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 21:08:41 +0000
commit1c83eb444727c703709f7deea88e51f8da2e504e (patch)
tree4c7153390bc1fafd217eff84d113f5ff1ae102f2 /chrome/common/gtk_util.cc
parent303bdcbbda3d59a6fb2c475a98a1ce4793ab1817 (diff)
downloadchromium_src-1c83eb444727c703709f7deea88e51f8da2e504e.zip
chromium_src-1c83eb444727c703709f7deea88e51f8da2e504e.tar.gz
chromium_src-1c83eb444727c703709f7deea88e51f8da2e504e.tar.bz2
Linux focus ring color: Go through WebKit::WebColor api rather than through the webview.
Also use SkColor isntead of a triplet of colors in RenderPreferences. BUG=21521 Review URL: http://codereview.chromium.org/195059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26013 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/gtk_util.cc')
-rw-r--r--chrome/common/gtk_util.cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/chrome/common/gtk_util.cc b/chrome/common/gtk_util.cc
index e026877..605e1a8 100644
--- a/chrome/common/gtk_util.cc
+++ b/chrome/common/gtk_util.cc
@@ -16,6 +16,7 @@
#include "chrome/common/renderer_preferences.h"
#include "grit/theme_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
+#include "third_party/skia/include/core/SkColor.h"
namespace {
@@ -405,9 +406,8 @@ void InitRendererPrefsFromGtkSettings(RendererPreferences* prefs) {
// base[SELECTED] seems more appropriate but in practice it is often too light
// to be easily visible.
GdkColor color = style->bg[GTK_STATE_SELECTED];
- prefs->focus_ring_color_r = color.red / 257;
- prefs->focus_ring_color_g = color.green / 257;
- prefs->focus_ring_color_b = color.blue / 257;
+ prefs->focus_ring_color =
+ SkColorSetRGB(color.red / 257, color.green / 257, color.blue / 257);
if (hint_style)
g_free(hint_style);
@@ -474,4 +474,19 @@ GdkColor AverageColors(GdkColor color_one, GdkColor color_two) {
return average_color;
}
+void SetAlwaysShowImage(GtkWidget* image_menu_item) {
+#if GTK_CHECK_VERSION(2, 16, 1)
+ gtk_image_menu_item_set_always_show_image(
+ GTK_IMAGE_MENU_ITEM(image_menu_item), TRUE);
+#else
+ 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