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 2190453002: Update CrOS logout button for MD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix override Created 4 years, 4 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/controls/button/label_button.h ('k') | ui/views/controls/button/md_text_button.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/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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 cached_bold_font_list_ = font_list.DeriveWithWeight( 185 cached_bold_font_list_ = font_list.DeriveWithWeight(
186 GetValueBolderThan(font_list.GetFontWeight())); 186 GetValueBolderThan(font_list.GetFontWeight()));
187 if (is_default_) { 187 if (is_default_) {
188 label_->SetFontList(cached_bold_font_list_); 188 label_->SetFontList(cached_bold_font_list_);
189 return; 189 return;
190 } 190 }
191 } 191 }
192 label_->SetFontList(cached_normal_font_list_); 192 label_->SetFontList(cached_normal_font_list_);
193 } 193 }
194 194
195 void LabelButton::AdjustFontSize(int font_size_delta) {
196 LabelButton::SetFontList(GetFontList().DeriveWithSizeDelta(font_size_delta));
197 }
198
195 void LabelButton::SetElideBehavior(gfx::ElideBehavior elide_behavior) { 199 void LabelButton::SetElideBehavior(gfx::ElideBehavior elide_behavior) {
196 label_->SetElideBehavior(elide_behavior); 200 label_->SetElideBehavior(elide_behavior);
197 } 201 }
198 202
199 void LabelButton::SetHorizontalAlignment(gfx::HorizontalAlignment alignment) { 203 void LabelButton::SetHorizontalAlignment(gfx::HorizontalAlignment alignment) {
200 DCHECK_NE(gfx::ALIGN_TO_HEAD, alignment); 204 DCHECK_NE(gfx::ALIGN_TO_HEAD, alignment);
201 horizontal_alignment_ = alignment; 205 horizontal_alignment_ = alignment;
202 InvalidateLayout(); 206 InvalidateLayout();
203 } 207 }
204 208
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 void LabelButton::ResetLabelEnabledColor() { 593 void LabelButton::ResetLabelEnabledColor() {
590 const SkColor color = 594 const SkColor color =
591 explicitly_set_colors_[state()] 595 explicitly_set_colors_[state()]
592 ? button_state_colors_[state()] 596 ? button_state_colors_[state()]
593 : PlatformStyle::TextColorForButton(button_state_colors_, *this); 597 : PlatformStyle::TextColorForButton(button_state_colors_, *this);
594 if (state() != STATE_DISABLED && label_->enabled_color() != color) 598 if (state() != STATE_DISABLED && label_->enabled_color() != color)
595 label_->SetEnabledColor(color); 599 label_->SetEnabledColor(color);
596 } 600 }
597 601
598 } // namespace views 602 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/label_button.h ('k') | ui/views/controls/button/md_text_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698