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

Side by Side Diff: ui/views/controls/button/label_button.cc

Issue 2251123002: macviews: honor system control tint setting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use luminance Created 4 years, 3 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 | « ui/views/cocoa/views_nswindow_delegate.mm ('k') | no next file » | 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/views/controls/button/label_button.h" 5 #include "ui/views/controls/button/label_button.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 // Typically the border renders differently when focused. 419 // Typically the border renders differently when focused.
420 SchedulePaint(); 420 SchedulePaint();
421 } 421 }
422 422
423 void LabelButton::OnNativeThemeChanged(const ui::NativeTheme* theme) { 423 void LabelButton::OnNativeThemeChanged(const ui::NativeTheme* theme) {
424 ResetColorsFromNativeTheme(); 424 ResetColorsFromNativeTheme();
425 UpdateThemedBorder(); 425 UpdateThemedBorder();
426 ResetLabelEnabledColor(); 426 ResetLabelEnabledColor();
427 // Invalidate the layout to pickup the new insets from the border. 427 // Invalidate the layout to pickup the new insets from the border.
428 InvalidateLayout(); 428 InvalidateLayout();
429 // The entire button has to be repainted here, since the native theme can
430 // define the tint for the entire background/border/focus ring.
431 SchedulePaint();
429 } 432 }
430 433
431 void LabelButton::AddInkDropLayer(ui::Layer* ink_drop_layer) { 434 void LabelButton::AddInkDropLayer(ui::Layer* ink_drop_layer) {
432 image()->SetPaintToLayer(true); 435 image()->SetPaintToLayer(true);
433 image()->layer()->SetFillsBoundsOpaquely(false); 436 image()->layer()->SetFillsBoundsOpaquely(false);
434 ink_drop_container_->SetVisible(true); 437 ink_drop_container_->SetVisible(true);
435 ink_drop_container_->layer()->Add(ink_drop_layer); 438 ink_drop_container_->layer()->Add(ink_drop_layer);
436 } 439 }
437 440
438 void LabelButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { 441 void LabelButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 void LabelButton::ResetLabelEnabledColor() { 609 void LabelButton::ResetLabelEnabledColor() {
607 const SkColor color = 610 const SkColor color =
608 explicitly_set_colors_[state()] 611 explicitly_set_colors_[state()]
609 ? button_state_colors_[state()] 612 ? button_state_colors_[state()]
610 : PlatformStyle::TextColorForButton(button_state_colors_, *this); 613 : PlatformStyle::TextColorForButton(button_state_colors_, *this);
611 if (state() != STATE_DISABLED && label_->enabled_color() != color) 614 if (state() != STATE_DISABLED && label_->enabled_color() != color)
612 label_->SetEnabledColor(color); 615 label_->SetEnabledColor(color);
613 } 616 }
614 617
615 } // namespace views 618 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/cocoa/views_nswindow_delegate.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698