summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-21 19:05:18 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-21 19:05:18 +0000
commit62414488d650879c45a0bc41a4e8c4edb03ea9e3 (patch)
treeba694396740ef598a5bbedee0c3de666c50bfc00
parente9436162b8f0f076858263b3e2331d3d0d96150b (diff)
downloadchromium_src-62414488d650879c45a0bc41a4e8c4edb03ea9e3.zip
chromium_src-62414488d650879c45a0bc41a4e8c4edb03ea9e3.tar.gz
chromium_src-62414488d650879c45a0bc41a4e8c4edb03ea9e3.tar.bz2
GTK: Override cursor colors in chrome-theme mode.
On dark gtk themes with light text, the cursor is often white, so in chrome-theme mode we had a white cursor on white background. BUG=40094 TEST=none Review URL: http://codereview.chromium.org/1723001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45213 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc2
-rw-r--r--chrome/browser/gtk/find_bar_gtk.cc2
-rw-r--r--gfx/gtk_util.cc1
-rw-r--r--gfx/gtk_util.h1
4 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
index ccdb0da..006395f 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
@@ -620,6 +620,7 @@ void AutocompleteEditViewGtk::SetBaseColor() {
#endif
if (use_gtk) {
+ gtk_widget_modify_cursor(text_view_, NULL, NULL);
gtk_widget_modify_base(text_view_, GTK_STATE_NORMAL, NULL);
gtk_widget_modify_base(text_view_, GTK_STATE_SELECTED, NULL);
gtk_widget_modify_text(text_view_, GTK_STATE_SELECTED, NULL);
@@ -647,6 +648,7 @@ void AutocompleteEditViewGtk::SetBaseColor() {
#else
background_color_ptr = &LocationBarViewGtk::kBackgroundColor;
#endif
+ gtk_widget_modify_cursor(text_view_, &gfx::kGdkBlack, &gfx::kGdkGray);
gtk_widget_modify_base(text_view_, GTK_STATE_NORMAL, background_color_ptr);
#if !defined(TOOLKIT_VIEWS)
diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc
index e3bc7ff..b8785da 100644
--- a/chrome/browser/gtk/find_bar_gtk.cc
+++ b/chrome/browser/gtk/find_bar_gtk.cc
@@ -456,6 +456,7 @@ void FindBarGtk::Observe(NotificationType type,
container_height_ = -1;
if (theme_provider_->UseGtkTheme()) {
+ gtk_widget_modify_cursor(text_entry_, NULL, NULL);
gtk_widget_modify_base(text_entry_, GTK_STATE_NORMAL, NULL);
gtk_widget_modify_text(text_entry_, GTK_STATE_NORMAL, NULL);
@@ -482,6 +483,7 @@ void FindBarGtk::Observe(NotificationType type,
gtk_misc_set_alignment(GTK_MISC(match_count_label_), 0.5, 0.5);
} else {
+ gtk_widget_modify_cursor(text_entry_, &gfx::kGdkBlack, &gfx::kGdkGray);
gtk_widget_modify_base(text_entry_, GTK_STATE_NORMAL,
&kEntryBackgroundColor);
gtk_widget_modify_text(text_entry_, GTK_STATE_NORMAL,
diff --git a/gfx/gtk_util.cc b/gfx/gtk_util.cc
index 1f5b370..bbed191 100644
--- a/gfx/gtk_util.cc
+++ b/gfx/gtk_util.cc
@@ -25,6 +25,7 @@ void FreePixels(guchar* pixels, gpointer data) {
namespace gfx {
const GdkColor kGdkWhite = GDK_COLOR_RGB(0xff, 0xff, 0xff);
+const GdkColor kGdkGray = GDK_COLOR_RGB(0x7f, 0x7f, 0x7f);
const GdkColor kGdkBlack = GDK_COLOR_RGB(0x00, 0x00, 0x00);
const GdkColor kGdkGreen = GDK_COLOR_RGB(0x00, 0xff, 0x00);
diff --git a/gfx/gtk_util.h b/gfx/gtk_util.h
index cc1fa8a..5af37df 100644
--- a/gfx/gtk_util.h
+++ b/gfx/gtk_util.h
@@ -31,6 +31,7 @@ namespace gfx {
class Rect;
extern const GdkColor kGdkWhite;
+extern const GdkColor kGdkGray;
extern const GdkColor kGdkBlack;
extern const GdkColor kGdkGreen;