Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update location bar when brave theme changes #408

Merged
merged 1 commit into from
Sep 6, 2018
Merged

Conversation

simonhong
Copy link
Member

@simonhong simonhong commented Sep 6, 2018

Close brave/brave-browser#974

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.
  • Add appropriate QA labels (QA/Needed or QA/No-QA-Needed) to include the closed issue in milestone

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

@petemill
Copy link
Member

petemill commented Sep 6, 2018

This works to fix the specific issue for LocationBar, since it does not use ThemeService properties but uses OmniboxTheme which can also change between light and dark. However, as discussed, this does not fix the view items which use properties from NativeTheme, which also has different light and dark implementations.

One possible strategy to solve both cases is to simply call OnNativeThemeChanged instead or in addition to OnThemeChanged for all Views, then everything should re-paint properly when our theme mode preference is changed.

Here's an example of why we want OnNativeThemeChanged to fire for all views

void Label::OnNativeThemeChanged(const ui::NativeTheme* theme) {
  UpdateColorsFromTheme(theme);
}

@simonhong simonhong force-pushed the location_bar branch 3 times, most recently from 7f500e8 to fae0735 Compare September 6, 2018 08:52
@simonhong
Copy link
Member Author

@petemill Location bar seems changed properly when theme changed.

Copy link
Member

@petemill petemill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks

@petemill petemill merged commit 8f1cc94 into master Sep 6, 2018
petemill added a commit that referenced this pull request Sep 6, 2018
Update location bar when brave theme changes
@petemill
Copy link
Member

petemill commented Sep 6, 2018

0.55.x f99debb

@petemill petemill deleted the location_bar branch September 6, 2018 17:22
@bbondy bbondy added the 0.55.x label Sep 6, 2018
@bbondy bbondy added this to the 0.55.x - Release milestone Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LocationBar color doesn't update when changing theme
3 participants