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

Side by Side Diff: ui/native_theme/native_theme_win.cc

Issue 2413223003: Views:: Make Labels support text selection. (Closed)
Patch Set: Fix text selection background color on Windows. Created 4 years, 1 month 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 | « ui/native_theme/native_theme_mac.mm ('k') | ui/views/controls/label.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/native_theme/native_theme_win.h" 5 #include "ui/native_theme/native_theme_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <uxtheme.h> 9 #include <uxtheme.h>
10 #include <vsstyle.h> 10 #include <vsstyle.h>
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 // MenuItem: 510 // MenuItem:
511 const SkColor kMenuSchemeHighlightBackgroundColorInvert = 511 const SkColor kMenuSchemeHighlightBackgroundColorInvert =
512 SkColorSetRGB(0x30, 0x30, 0x30); 512 SkColorSetRGB(0x30, 0x30, 0x30);
513 // Table: 513 // Table:
514 const SkColor kPositiveTextColor = SkColorSetRGB(0x0b, 0x80, 0x43); 514 const SkColor kPositiveTextColor = SkColorSetRGB(0x0b, 0x80, 0x43);
515 const SkColor kNegativeTextColor = SkColorSetRGB(0xc5, 0x39, 0x29); 515 const SkColor kNegativeTextColor = SkColorSetRGB(0xc5, 0x39, 0x29);
516 // Results Tables: 516 // Results Tables:
517 const SkColor kResultsTableUrlColor = 517 const SkColor kResultsTableUrlColor =
518 md ? gfx::kGoogleBlue700 : SkColorSetRGB(0x0b, 0x80, 0x43); 518 md ? gfx::kGoogleBlue700 : SkColorSetRGB(0x0b, 0x80, 0x43);
519 const SkColor kResultsTableSelectedUrlColor = SK_ColorWHITE; 519 const SkColor kResultsTableSelectedUrlColor = SK_ColorWHITE;
520 // Label:
521 const SkColor kLabelTextSelectionBackgroundFocusedColor = gfx::kGoogleBlue700;
520 522
521 switch (color_id) { 523 switch (color_id) {
522 // Windows 524 // Windows
523 case kColorId_WindowBackground: 525 case kColorId_WindowBackground:
524 return system_colors_[COLOR_WINDOW]; 526 return system_colors_[COLOR_WINDOW];
525 527
526 // Dialogs 528 // Dialogs
527 case kColorId_DialogBackground: 529 case kColorId_DialogBackground:
528 case kColorId_BubbleBackground: 530 case kColorId_BubbleBackground:
529 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) 531 if (ui::MaterialDesignController::IsSecondaryUiMaterial())
(...skipping 12 matching lines...) Expand all
542 case kColorId_ButtonEnabledColor: 544 case kColorId_ButtonEnabledColor:
543 return system_colors_[COLOR_BTNTEXT]; 545 return system_colors_[COLOR_BTNTEXT];
544 case kColorId_ButtonHoverColor: 546 case kColorId_ButtonHoverColor:
545 return kButtonHoverColor; 547 return kButtonHoverColor;
546 548
547 // Label 549 // Label
548 case kColorId_LabelEnabledColor: 550 case kColorId_LabelEnabledColor:
549 return system_colors_[COLOR_BTNTEXT]; 551 return system_colors_[COLOR_BTNTEXT];
550 case kColorId_LabelDisabledColor: 552 case kColorId_LabelDisabledColor:
551 return system_colors_[COLOR_GRAYTEXT]; 553 return system_colors_[COLOR_GRAYTEXT];
554 case kColorId_LabelTextSelectionColor:
555 return system_colors_[COLOR_HIGHLIGHTTEXT];
556 case kColorId_LabelTextSelectionBackgroundFocused:
557 return kLabelTextSelectionBackgroundFocusedColor;
karandeepb 2016/11/07 04:06:36 Tested the patch on Windows as well. Had to chan
552 558
553 // Textfield 559 // Textfield
554 case kColorId_TextfieldDefaultColor: 560 case kColorId_TextfieldDefaultColor:
555 return system_colors_[COLOR_WINDOWTEXT]; 561 return system_colors_[COLOR_WINDOWTEXT];
556 case kColorId_TextfieldDefaultBackground: 562 case kColorId_TextfieldDefaultBackground:
557 return system_colors_[COLOR_WINDOW]; 563 return system_colors_[COLOR_WINDOW];
558 case kColorId_TextfieldReadOnlyColor: 564 case kColorId_TextfieldReadOnlyColor:
559 return system_colors_[COLOR_GRAYTEXT]; 565 return system_colors_[COLOR_GRAYTEXT];
560 case kColorId_TextfieldReadOnlyBackground: 566 case kColorId_TextfieldReadOnlyBackground:
561 return system_colors_[COLOR_3DFACE]; 567 return system_colors_[COLOR_3DFACE];
(...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after
2112 break; 2118 break;
2113 case LAST: 2119 case LAST:
2114 NOTREACHED(); 2120 NOTREACHED();
2115 break; 2121 break;
2116 } 2122 }
2117 theme_handles_[theme_name] = handle; 2123 theme_handles_[theme_name] = handle;
2118 return handle; 2124 return handle;
2119 } 2125 }
2120 2126
2121 } // namespace ui 2127 } // namespace ui
OLDNEW
« no previous file with comments | « ui/native_theme/native_theme_mac.mm ('k') | ui/views/controls/label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698