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

Side by Side Diff: chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc

Issue 258713002: Linux Aura: get tooltip background color from theme (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/native_theme/fallback_theme.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/libgtk2ui/native_theme_gtk2.h" 5 #include "chrome/browser/ui/libgtk2ui/native_theme_gtk2.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "chrome/browser/ui/libgtk2ui/chrome_gtk_menu_subclasses.h" 9 #include "chrome/browser/ui/libgtk2ui/chrome_gtk_menu_subclasses.h"
10 #include "chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h" 10 #include "chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 return GetEntryStyle()->base[GTK_STATE_NORMAL]; 238 return GetEntryStyle()->base[GTK_STATE_NORMAL];
239 case kColorId_TextfieldReadOnlyColor: 239 case kColorId_TextfieldReadOnlyColor:
240 return GetEntryStyle()->text[GTK_STATE_INSENSITIVE]; 240 return GetEntryStyle()->text[GTK_STATE_INSENSITIVE];
241 case kColorId_TextfieldReadOnlyBackground: 241 case kColorId_TextfieldReadOnlyBackground:
242 return GetEntryStyle()->base[GTK_STATE_INSENSITIVE]; 242 return GetEntryStyle()->base[GTK_STATE_INSENSITIVE];
243 case kColorId_TextfieldSelectionColor: 243 case kColorId_TextfieldSelectionColor:
244 return GetEntryStyle()->text[GTK_STATE_SELECTED]; 244 return GetEntryStyle()->text[GTK_STATE_SELECTED];
245 case kColorId_TextfieldSelectionBackgroundFocused: 245 case kColorId_TextfieldSelectionBackgroundFocused:
246 return GetEntryStyle()->base[GTK_STATE_SELECTED]; 246 return GetEntryStyle()->base[GTK_STATE_SELECTED];
247 247
248 // Trees and Tables (implemented on GTK using the same class) 248 // Tooltips
249 case kColorId_TooltipBackground:
250 return GetWindowStyle()->bg[GTK_STATE_NORMAL];
251
252 // Trees and Tables (implemented on GTK using the same class)
249 case kColorId_TableBackground: 253 case kColorId_TableBackground:
250 case kColorId_TreeBackground: 254 case kColorId_TreeBackground:
251 return GetTreeStyle()->bg[GTK_STATE_NORMAL]; 255 return GetTreeStyle()->bg[GTK_STATE_NORMAL];
252 case kColorId_TableText: 256 case kColorId_TableText:
253 case kColorId_TreeText: 257 case kColorId_TreeText:
254 return GetTreeStyle()->text[GTK_STATE_NORMAL]; 258 return GetTreeStyle()->text[GTK_STATE_NORMAL];
255 case kColorId_TableSelectedText: 259 case kColorId_TableSelectedText:
256 case kColorId_TableSelectedTextUnfocused: 260 case kColorId_TableSelectedTextUnfocused:
257 case kColorId_TreeSelectedText: 261 case kColorId_TreeSelectedText:
258 case kColorId_TreeSelectedTextUnfocused: 262 case kColorId_TreeSelectedTextUnfocused:
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 case kColorId_ResultsTableHoveredDivider: { 317 case kColorId_ResultsTableHoveredDivider: {
314 GtkStyle* win_style = GetWindowStyle(); 318 GtkStyle* win_style = GetWindowStyle();
315 return GdkAlphaBlend(win_style->text[GTK_STATE_PRELIGHT], 319 return GdkAlphaBlend(win_style->text[GTK_STATE_PRELIGHT],
316 win_style->bg[GTK_STATE_PRELIGHT], 0x34); 320 win_style->bg[GTK_STATE_PRELIGHT], 0x34);
317 } 321 }
318 case kColorId_ResultsTableSelectedDivider: { 322 case kColorId_ResultsTableSelectedDivider: {
319 GtkStyle* win_style = GetWindowStyle(); 323 GtkStyle* win_style = GetWindowStyle();
320 return GdkAlphaBlend(win_style->text[GTK_STATE_SELECTED], 324 return GdkAlphaBlend(win_style->text[GTK_STATE_SELECTED],
321 win_style->bg[GTK_STATE_SELECTED], 0x34); 325 win_style->bg[GTK_STATE_SELECTED], 0x34);
322 } 326 }
323 default:
324 // Fall through
325 break;
326 } 327 }
327 328
328 return SkColorToGdkColor(kInvalidColorIdColor); 329 return SkColorToGdkColor(kInvalidColorIdColor);
329 } 330 }
330 331
331 GtkWidget* NativeThemeGtk2::GetRealizedWindow() const { 332 GtkWidget* NativeThemeGtk2::GetRealizedWindow() const {
332 if (!fake_window_) { 333 if (!fake_window_) {
333 fake_window_ = gtk_window_new(GTK_WINDOW_TOPLEVEL); 334 fake_window_ = gtk_window_new(GTK_WINDOW_TOPLEVEL);
334 gtk_widget_realize(fake_window_); 335 gtk_widget_realize(fake_window_);
335 } 336 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 fake_menu_.Own(gtk_custom_menu_new()); 387 fake_menu_.Own(gtk_custom_menu_new());
387 388
388 fake_menu_item_ = gtk_custom_menu_item_new(); 389 fake_menu_item_ = gtk_custom_menu_item_new();
389 gtk_menu_shell_append(GTK_MENU_SHELL(fake_menu_.get()), fake_menu_item_); 390 gtk_menu_shell_append(GTK_MENU_SHELL(fake_menu_.get()), fake_menu_item_);
390 } 391 }
391 392
392 return gtk_rc_get_style(fake_menu_item_); 393 return gtk_rc_get_style(fake_menu_item_);
393 } 394 }
394 395
395 } // namespace libgtk2ui 396 } // namespace libgtk2ui
OLDNEW
« 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