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

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

Issue 795933009: [AiS] for desktop, two lines and font sytles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Colors from the UI theme 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.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/gtk2_ui.h" 10 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 case kColorId_ResultsTableHoveredDivider: { 366 case kColorId_ResultsTableHoveredDivider: {
367 GtkStyle* win_style = GetWindowStyle(); 367 GtkStyle* win_style = GetWindowStyle();
368 return GdkAlphaBlend(win_style->text[GTK_STATE_PRELIGHT], 368 return GdkAlphaBlend(win_style->text[GTK_STATE_PRELIGHT],
369 win_style->bg[GTK_STATE_PRELIGHT], 0x34); 369 win_style->bg[GTK_STATE_PRELIGHT], 0x34);
370 } 370 }
371 case kColorId_ResultsTableSelectedDivider: { 371 case kColorId_ResultsTableSelectedDivider: {
372 GtkStyle* win_style = GetWindowStyle(); 372 GtkStyle* win_style = GetWindowStyle();
373 return GdkAlphaBlend(win_style->text[GTK_STATE_SELECTED], 373 return GdkAlphaBlend(win_style->text[GTK_STATE_SELECTED],
374 win_style->bg[GTK_STATE_SELECTED], 0x34); 374 win_style->bg[GTK_STATE_SELECTED], 0x34);
375 } 375 }
376
377 // Answers
378 case kColorId_AnswerNormalText:
379 return GetEntryStyle()->text[GTK_STATE_NORMAL];
380 case kColorId_AnswerNormalTextHovered:
381 return GetEntryStyle()->text[GTK_STATE_PRELIGHT];
382 case kColorId_AnswerNormalTextSelected:
383 return GetEntryStyle()->text[GTK_STATE_SELECTED];
384 case kColorId_AnswerInfoText: {
385 GtkStyle* entry_style = GetEntryStyle();
386 return GdkAlphaBlend(entry_style->text[GTK_STATE_NORMAL],
387 entry_style->base[GTK_STATE_NORMAL], 0x80);
388 }
389 case kColorId_AnswerInfoTextHovered: {
390 GtkStyle* entry_style = GetEntryStyle();
391 return GdkAlphaBlend(entry_style->text[GTK_STATE_PRELIGHT],
392 entry_style->base[GTK_STATE_PRELIGHT], 0x80);
393 }
394 case kColorId_AnswerInfoTextSelected: {
395 GtkStyle* entry_style = GetEntryStyle();
396 return GdkAlphaBlend(entry_style->text[GTK_STATE_SELECTED],
397 entry_style->base[GTK_STATE_SELECTED], 0x80);
398 }
399 case kColorId_AnswerLinkText: {
400 GdkColor color = {0};
401 color.blue = ~0;
402 return color;
403 }
404 case kColorId_AnswerLinkTextHovered: {
405 GdkColor color = {0};
406 color.blue = ~0;
407 GtkStyle* entry_style = GetEntryStyle();
408 return GdkAlphaBlend(color, entry_style->base[GTK_STATE_SELECTED], 0x80);
409 }
410 case kColorId_AnswerLinkTextSelected: {
411 GdkColor color = {0};
412 color.blue = ~0;
413 GtkStyle* entry_style = GetEntryStyle();
414 return GdkAlphaBlend(color, entry_style->base[GTK_STATE_SELECTED], 0x80);
415 }
416 case kColorId_AnswerPositiveText: {
417 GdkColor color = {0};
418 color.green = ~0;
419 return color;
420 }
421 case kColorId_AnswerPositiveTextHovered: {
422 GdkColor color = {0};
423 color.green = ~0;
424 GtkStyle* entry_style = GetEntryStyle();
425 return GdkAlphaBlend(color, entry_style->base[GTK_STATE_PRELIGHT], 0x80);
426 }
427 case kColorId_AnswerPositiveTextSelected: {
428 GdkColor color = {0};
429 color.green = ~0;
430 GtkStyle* entry_style = GetEntryStyle();
431 return GdkAlphaBlend(color, entry_style->base[GTK_STATE_SELECTED], 0x80);
432 }
433 case kColorId_AnswerNegativeText: {
434 GdkColor color = {0};
435 color.red = ~0;
436 return color;
437 }
438 case kColorId_AnswerNegativeTextHovered: {
439 GdkColor color = {0};
440 color.red = ~0;
441 GtkStyle* entry_style = GetEntryStyle();
442 return GdkAlphaBlend(color, entry_style->base[GTK_STATE_PRELIGHT], 0x80);
443 }
444 case kColorId_AnswerNegativeTextSelected: {
445 GdkColor color = {0};
446 color.red = ~0;
447 GtkStyle* entry_style = GetEntryStyle();
448 return GdkAlphaBlend(color, entry_style->base[GTK_STATE_SELECTED], 0x80);
449 }
376 case kColorId_NumColors: 450 case kColorId_NumColors:
377 NOTREACHED(); 451 NOTREACHED();
378 break; 452 break;
379 } 453 }
380
381 return SkColorToGdkColor(kInvalidColorIdColor); 454 return SkColorToGdkColor(kInvalidColorIdColor);
dschuyler 2015/03/13 06:01:24 I removed the blank line by mistake. I'll add it
382 } 455 }
383 456
384 GtkWidget* NativeThemeGtk2::GetRealizedWindow() const { 457 GtkWidget* NativeThemeGtk2::GetRealizedWindow() const {
385 if (!fake_window_) { 458 if (!fake_window_) {
386 fake_window_ = gtk_window_new(GTK_WINDOW_TOPLEVEL); 459 fake_window_ = gtk_window_new(GTK_WINDOW_TOPLEVEL);
387 gtk_widget_realize(fake_window_); 460 gtk_widget_realize(fake_window_);
388 } 461 }
389 462
390 return fake_window_; 463 return fake_window_;
391 } 464 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 0, 0, 559 0, 0,
487 rect.width(), rect.height()); 560 rect.width(), rect.height());
488 SkBitmap arrow = GdkPixbufToImageSkia(pb); 561 SkBitmap arrow = GdkPixbufToImageSkia(pb);
489 canvas->drawBitmap(arrow, rect.x(), rect.y()); 562 canvas->drawBitmap(arrow, rect.x(), rect.y());
490 563
491 g_object_unref(pb); 564 g_object_unref(pb);
492 g_object_unref(pm); 565 g_object_unref(pm);
493 } 566 }
494 567
495 } // namespace libgtk2ui 568 } // namespace libgtk2ui
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698