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

Issue 2620453005: Material Design: Fix MdLabelButton not updating text colors on theme changes (Closed)

Created:
3 years, 11 months ago by Tom (Use chromium acct)
Modified:
3 years, 11 months ago
Reviewers:
sky, Evan Stade
CC:
chromium-reviews, tfarina, Elliot Glaysher
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Material Design: Fix MdLabelButton not updating text colors on theme changes MdTextButton previously had this code: if (!explicitly_set_normal_color()) LabelButton::SetEnabledTextColors(theme->GetSystemColor(fg_color_id)); The call to SetEnabledTextColors() caused subsequent calls to explicitly_set_normal_color() to be true, even though the colors were inferred from the native theme. When using the Gtk3 theme, when Chrome first starts, GetNativeTheme() doesn't return an instance of NativeThemeGtk3, so when the initial text color is set, it's using an old theme. This was causing the "Set Chrome as default" button to have incorrect colors (but for some reason the background had the right color). The fix in this CL is to reset explicitly_set_text_colors_ after SetEnabledTextColors(). R=estade@chromium.org CC=erg@chromium.org Review-Url: https://codereview.chromium.org/2620453005 Cr-Commit-Position: refs/heads/master@{#442463} Committed: https://chromium.googlesource.com/chromium/src/+/532dbca20c3c49d6f543e6fe137f8b7e21832bb1

Patch Set 1 #

Patch Set 2 : Refactor #

Total comments: 2

Patch Set 3 : Add [set_]explicitly_set_text_colors() #

Total comments: 4

Patch Set 4 : const & #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -2 lines) Patch
M ui/views/controls/button/label_button.h View 1 2 3 3 chunks +9 lines, -1 line 0 comments Download
M ui/views/controls/button/md_text_button.cc View 1 2 1 chunk +4 lines, -1 line 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 17 (5 generated)
Tom (Use chromium acct)
estade@ PTAL. This is a bit of a hack erg@ FYI
3 years, 11 months ago (2017-01-06 21:45:43 UTC) #1
Evan Stade
I think you should copy this[1], i.e. unset the explicitly set flag right after setting ...
3 years, 11 months ago (2017-01-06 22:09:44 UTC) #2
Tom (Use chromium acct)
On 2017/01/06 22:09:44, Evan Stade wrote: > I think you should copy this[1], i.e. unset ...
3 years, 11 months ago (2017-01-07 01:12:44 UTC) #3
Evan Stade
https://codereview.chromium.org/2620453005/diff/20001/ui/views/controls/button/label_button.cc File ui/views/controls/button/label_button.cc (right): https://codereview.chromium.org/2620453005/diff/20001/ui/views/controls/button/label_button.cc#newcode381 ui/views/controls/button/label_button.cc:381: for (ButtonState state : {STATE_NORMAL, STATE_HOVERED, STATE_PRESSED}) hmm, this ...
3 years, 11 months ago (2017-01-07 01:31:40 UTC) #4
Tom (Use chromium acct)
https://codereview.chromium.org/2620453005/diff/20001/ui/views/controls/button/label_button.cc File ui/views/controls/button/label_button.cc (right): https://codereview.chromium.org/2620453005/diff/20001/ui/views/controls/button/label_button.cc#newcode381 ui/views/controls/button/label_button.cc:381: for (ButtonState state : {STATE_NORMAL, STATE_HOVERED, STATE_PRESSED}) On 2017/01/07 ...
3 years, 11 months ago (2017-01-07 02:35:11 UTC) #6
Tom (Use chromium acct)
pinging estade@
3 years, 11 months ago (2017-01-09 19:20:44 UTC) #7
Evan Stade
+sky https://codereview.chromium.org/2620453005/diff/40001/ui/views/controls/button/label_button.h File ui/views/controls/button/label_button.h (right): https://codereview.chromium.org/2620453005/diff/40001/ui/views/controls/button/label_button.h#newcode154 ui/views/controls/button/label_button.h:154: std::array<bool, STATE_COUNT> explicitly_set_colors() const { should this return ...
3 years, 11 months ago (2017-01-09 20:02:30 UTC) #9
Tom (Use chromium acct)
https://codereview.chromium.org/2620453005/diff/40001/ui/views/controls/button/label_button.h File ui/views/controls/button/label_button.h (right): https://codereview.chromium.org/2620453005/diff/40001/ui/views/controls/button/label_button.h#newcode154 ui/views/controls/button/label_button.h:154: std::array<bool, STATE_COUNT> explicitly_set_colors() const { On 2017/01/09 20:02:30, Evan ...
3 years, 11 months ago (2017-01-09 20:31:50 UTC) #10
sky
LGTM
3 years, 11 months ago (2017-01-09 22:23:53 UTC) #11
Evan Stade
lgtm
3 years, 11 months ago (2017-01-09 22:47:52 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2620453005/60001
3 years, 11 months ago (2017-01-10 00:23:24 UTC) #14
commit-bot: I haz the power
3 years, 11 months ago (2017-01-10 03:14:16 UTC) #17
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/532dbca20c3c49d6f543e6fe137f...

Powered by Google App Engine
This is Rietveld 408576698