| OLD | NEW |
| 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 Loading... |
| 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 | 454 |
| 381 return SkColorToGdkColor(kInvalidColorIdColor); | 455 return SkColorToGdkColor(kInvalidColorIdColor); |
| 382 } | 456 } |
| 383 | 457 |
| 384 GtkWidget* NativeThemeGtk2::GetRealizedWindow() const { | 458 GtkWidget* NativeThemeGtk2::GetRealizedWindow() const { |
| 385 if (!fake_window_) { | 459 if (!fake_window_) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 0, 0, | 560 0, 0, |
| 487 rect.width(), rect.height()); | 561 rect.width(), rect.height()); |
| 488 SkBitmap arrow = GdkPixbufToImageSkia(pb); | 562 SkBitmap arrow = GdkPixbufToImageSkia(pb); |
| 489 canvas->drawBitmap(arrow, rect.x(), rect.y()); | 563 canvas->drawBitmap(arrow, rect.x(), rect.y()); |
| 490 | 564 |
| 491 g_object_unref(pb); | 565 g_object_unref(pb); |
| 492 g_object_unref(pm); | 566 g_object_unref(pm); |
| 493 } | 567 } |
| 494 | 568 |
| 495 } // namespace libgtk2ui | 569 } // namespace libgtk2ui |
| OLD | NEW |