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

Unified Diff: ui/views/controls/button/label_button.cc

Issue 1926943002: Introduce new flag to control usage of MD in secondary (not top-chrome) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: new fn name Created 4 years, 7 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/label_button.cc
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc
index d583a109b59abfedfa05ff1b8f94295a99c43fec..3623bc2f8bb55f2d220ca552a00d7b4a81a18fe0 100644
--- a/ui/views/controls/button/label_button.cc
+++ b/ui/views/controls/button/label_button.cc
@@ -201,10 +201,7 @@ void LabelButton::SetIsDefault(bool is_default) {
ui::Accelerator accel(ui::VKEY_RETURN, ui::EF_NONE);
is_default_ ? AddAccelerator(accel) : RemoveAccelerator(accel);
- const bool bold = PlatformStyle::kDefaultLabelButtonHasBoldFont && is_default;
- label_->SetFontList(bold ? cached_bold_font_list_ : cached_normal_font_list_);
- InvalidateLayout();
- ResetLabelEnabledColor();
+ UpdateStyleToIndicateDefaultStatus();
}
void LabelButton::SetStyle(ButtonStyle style) {
@@ -493,6 +490,14 @@ void LabelButton::ResetColorsFromNativeTheme() {
}
}
+void LabelButton::UpdateStyleToIndicateDefaultStatus() {
+ const bool bold =
+ PlatformStyle::kDefaultLabelButtonHasBoldFont && is_default_;
+ label_->SetFontList(bold ? cached_bold_font_list_ : cached_normal_font_list_);
+ InvalidateLayout();
+ ResetLabelEnabledColor();
+}
+
void LabelButton::UpdateImage() {
image_->SetImage(GetImage(state()));
ResetCachedPreferredSize();
« 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