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

Unified Diff: chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc

Issue 1020623002: [AiS] adding positive and negative theme values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comments for positive and negative text Created 5 years, 9 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 | « no previous file | ui/native_theme/fallback_theme.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc
diff --git a/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc b/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc
index 3dec05e03c2df7ed5ca6e361999b24e5561e8570..b48de493b772a347eabe5e02b578177603cc8c76 100644
--- a/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc
+++ b/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
#include "chrome/browser/ui/libgtk2ui/gtk2_util.h"
#include "chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h"
+#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
@@ -93,6 +94,11 @@ GdkColor SelectedURLColor(GdkColor foreground, GdkColor background) {
return libgtk2ui::SkColorToGdkColor(color_utils::HSLToSkColor(output, 255));
}
+GdkColor GetReadableColor(SkColor color, const GdkColor& background) {
+ return libgtk2ui::SkColorToGdkColor(color_utils::GetReadableColor(
+ color, libgtk2ui::GdkColorToSkColor(background)));
+}
+
} // namespace
@@ -373,6 +379,30 @@ GdkColor NativeThemeGtk2::GetSystemGdkColor(ColorId color_id) const {
return GdkAlphaBlend(win_style->text[GTK_STATE_SELECTED],
win_style->bg[GTK_STATE_SELECTED], 0x34);
}
+ case kColorId_ResultsTablePositiveText: {
+ return GetReadableColor(SK_ColorGREEN,
+ GetEntryStyle()->base[GTK_STATE_NORMAL]);
+ }
+ case kColorId_ResultsTablePositiveHoveredText: {
+ return GetReadableColor(SK_ColorGREEN,
+ GetEntryStyle()->base[GTK_STATE_PRELIGHT]);
+ }
+ case kColorId_ResultsTablePositiveSelectedText: {
+ return GetReadableColor(SK_ColorGREEN,
+ GetEntryStyle()->base[GTK_STATE_SELECTED]);
+ }
+ case kColorId_ResultsTableNegativeText: {
+ return GetReadableColor(SK_ColorRED,
+ GetEntryStyle()->base[GTK_STATE_NORMAL]);
+ }
+ case kColorId_ResultsTableNegativeHoveredText: {
+ return GetReadableColor(SK_ColorRED,
+ GetEntryStyle()->base[GTK_STATE_PRELIGHT]);
+ }
+ case kColorId_ResultsTableNegativeSelectedText: {
+ return GetReadableColor(SK_ColorRED,
+ GetEntryStyle()->base[GTK_STATE_SELECTED]);
+ }
case kColorId_NumColors:
NOTREACHED();
break;
« no previous file with comments | « no previous file | ui/native_theme/fallback_theme.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698