-
Notifications
You must be signed in to change notification settings - Fork 887
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
Specify color for focus ring #476
Conversation
class FocusRingTheme { | ||
public: | ||
SkColor GetSystemColor(int id) { | ||
DCHECK(id == ui::NativeTheme::kColorId_FocusedBorderColor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we guarantee id is always focused border color?
It seems that ColorIdForValidity
can return two kinds of id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch @simonhong. I'll modify to support the other Id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This other value is supported now. Though I could not get this state with our featureset. The places that I see focusring being used didn't have an error state:
- LocationBar
- Bookmark name popup
- Create Shortcut popup
- edit bookmark popup
I searched |
Fix brave/brave-browser#1190 In Chromium, this is specified in Native Theme, and overriden on macOS from the OS-level focus border color, but only for light theme (i.e. not incognito). In lieu of overriding all the Native Themes, this provides the 1 specific color to the FocusRing view. Whilst we may very well subclass all the Native Themes at some point, this is a pain-free way to get there for this feature of the design spec now.
bc831e8
to
725def1
Compare
@simonhong I searched too, and those items seemed minor, or not within the toolbar. The main purpose of this was to get the focus color for the LocationBar, but it's desirable that we have it for the rest of the Toolbar too, which this achieves. If some popups use a different (system-specific) color (when they use a different theme anyway), then that is ok. Do you agree? |
@petemill Ok, I agree! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
0.55.x 1a69af6 |
Fix brave/brave-browser#1190
In Chromium, this is specified in Native Theme, and overriden on macOS from the OS-level focus border color, but only for light theme (i.e. not incognito). In lieu of overriding all the Native Themes, this provides the 1 specific color to the FocusRing view. Whilst we may very well subclass all the Native Themes at some point, this is a pain-free way to get there for this feature of the design spec now.
Tested on Windows and macOS
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist: