New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 722595 link

Starred by 4 users

Issue metadata

Status: Verified
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Profile button default avatar doesn't work well with themes

Project Member Reported by est...@chromium.org, May 15 2017

Issue description

Since we hard-code the color of this icon, it's invisible on dark themes.

Currently this only matters for Linux but we'd like to update themed browser windows on Windows as well.
 
cZyQfhB9iOG.png
4.9 KB View Download
My comment various other places has been "reuse the icon, button background, and button hover color computation code from bsep's win 10 caption button work".  It might need slight tweaking on other platforms if there are bits that are win 10-specific, but what it does give you is a shared mechanism for computing e.g. the contrasting glyph and hover colors to use given a potentially themed frame.

Comment 2 by est...@chromium.org, May 19 2017

Cc: kavvaru@chromium.org est...@chromium.org brajkumar@chromium.org ajha@chromium.org
 Issue 724373  has been merged into this issue.

Comment 3 by bettes@chromium.org, May 19 2017

Ideally, the avatar button icon is painted in the same way the window controls are. Do you need a black svg from me?

Comment 4 by est...@chromium.org, May 19 2017

The window controls in this screenshot are PNGs. The shapes have a white fill and dark outline. I believe this dark color was actually chosen to match a light Win10 bg. I'm going to try what Peter suggests, although I'm not sure it's as easy as he's making it sound as we can't tell what the frame will look like in the case where a custom theme uses an image for the frame. Win10 has solid frame colors AFAIU.

I initially assigned to you Alan for a design decision on how to deal with this.
Bret's code was designed to work with themed window frames.  It overlays a semitransparent solid color on the caption buttons to ensure there's something there for the glyph color to contrast against no matter what the image looks like.

Comment 6 by est...@chromium.org, May 19 2017

can you point me at this code? Is it this?[1] We don't currently use this semi transparent bg on the caption buttons on Linux as far as I can tell, and I don't know if we can add it since we're still using raster assets there. We could add it to just the avatar but that will mean that button looks substantially unlike the others.

[1] https://cs.chromium.org/chromium/src/chrome/browser/ui/views/frame/windows_10_caption_button.cc?rcl=b8213899699b5b98f778b5a418d889fa25dc96dc&l=49
Yes, it's that code.  You can blend atop the raster assets (we used to do this for tabs in the tabstrip before top chrome MD).

There's also bug 644004 on doing all this stuff in general for the caption buttons and profile switcher on all platforms.  (I'm a bit confused about the different bugs we have here and how they overlap, but the end state we want is to be drawing the profile switcher like we draw the caption buttons, and to draw the caption buttons with some kind of consistent behavior like this that handles themes well, modulated by platform conventions as needed.)

Comment 8 by est...@chromium.org, May 24 2017

Owner: est...@chromium.org
Status: Started (was: Assigned)
After messing with this for a while, changing the color of the icon doesn't seem like the best option. No matter how smart we are about the color, it will not match the caption buttons which are always solid white with a grey outline.

Here's a screenshot of what I landed on, shown on a variety of themes. Two major changes (both of which only apply to Linux):
- icon is white with with a grey outline.
- button background actually matches the theme (this was never previously the case AFAICT).
theme_caption_buttons_linux.png
72.8 KB View Download
Yeah, if your caption button glyphs don't also change, then your profile button "glyph" (icon) can't either.  It definitely should match them.

What you've done seems good to me for now, albeit it won't match how we solve this on Windows.  I think longer-term it might be nice to have the caption button glyphs _and_ this icon not be white-with-black-outline, but be dynamically colored.  However, I don't know the typical caption button look on Linux well enough to know if that makes sense.
Even longer term, it seems hard to settle on one color without an outline for the themed case, because themes can define either a color or an image or both for the button bg and frame. If the theme only defines images, the bg colors won't help us determine a good fg color.

I think on Windows it was only solved for the unthemed case, right? The frame may change color but you'll at least be able to tell what the color is.
As with the tabstrip, we depend on themes setting the frame color to a reasonable approximation of the frame image's color when they define a frame image.  If they don't do this, they'll look broken, and we're OK with that.

So for Windows this was solved for the themed case, and when we tested with a variety of themes, it works fairly well in practice.

We could go further than this if we wanted to be forgiving to theme authors, and compute an "average" or "dominant" color from the frame image in the case where authors set that but not also the frame color.  I thought we had code to do that computation on an image somewhere anyway.  I consider that a "nice-to-have" though.
Project Member

Comment 12 by bugdroid1@chromium.org, May 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0b5abf2881817f9cba31ac3d6ba7d50d01924d78

commit 0b5abf2881817f9cba31ac3d6ba7d50d01924d78
Author: Evan Stade <estade@chromium.org>
Date: Fri May 26 15:53:21 2017

Linux: Improve avatar button for themed browser windows.

1. Draw fill color/image on avatar button. Some themes use a color,
   some have an image, or they can have both.
2. Make generic avatar icon white with a grey outline, just like the
   caption button icons.

BUG= 722595 

Change-Id: Ie05f2de9e677be2f04190ef8043e62bc4c1a7d73
Reviewed-on: https://chromium-review.googlesource.com/514448
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#475013}
[modify] https://crrev.com/0b5abf2881817f9cba31ac3d6ba7d50d01924d78/chrome/app/vector_icons/BUILD.gn
[add] https://crrev.com/0b5abf2881817f9cba31ac3d6ba7d50d01924d78/chrome/app/vector_icons/profile_switcher_outline.icon
[modify] https://crrev.com/0b5abf2881817f9cba31ac3d6ba7d50d01924d78/chrome/browser/ui/views/profiles/avatar_button.cc

Labels: -OS-Windows
Status: Fixed (was: Started)
Labels: M-60 Merge-Request-60
Status: Started (was: Fixed)
Cc: thomasanderson@chromium.org
 Issue 733021  has been merged into this issue.
Project Member

Comment 16 by sheriffbot@chromium.org, Jun 14 2017

Labels: -Merge-Request-60 Hotlist-Merge-Review Merge-Review-60
This bug requires manual review: M60 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), josafat@(ChromeOS), bustamante@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Review-60 Merge-Rejected-60
We're pretty late into M60 and cracking down on merges for this milestone, I'd prefer to wait until M61.  If this is a critical bug that can't wait until M61, feel free to add back the Merge-Request-60 label and justification/reasoning why this should be considered for 60 and we'll re-review.
Labels: -Merge-Rejected-60 Merge-Request-60
This is a low risk change that has baked for a long time without causing any known crashes. The bug is a pretty bad graphical glitch (see screenshot here[1]). It only missed the branch by a handful of hours, so the chances that it has a bad interaction with an earlier state of the tree are pretty low.

[1] https://bugs.chromium.org/p/chromium/issues/detail?id=733021#c5
Project Member

Comment 19 by sheriffbot@chromium.org, Jun 16 2017

Labels: -Merge-Request-60 Merge-Review-60
This bug requires manual review: M60 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), josafat@(ChromeOS), bustamante@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Review-60 Merge-Approved-60
Based on comment 18, approving merge to M60. 
Project Member

Comment 21 by sheriffbot@chromium.org, Jun 22 2017

Cc: abdulsyed@chromium.org
This issue has been approved for a merge. Please merge the fix to any appropriate branches as soon as possible!

If all merges have been completed, please remove any remaining Merge-Approved labels from this issue.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 22 by sheriffbot@chromium.org, Jun 26 2017

This issue has been approved for a merge. Please merge the fix to any appropriate branches as soon as possible!

If all merges have been completed, please remove any remaining Merge-Approved labels from this issue.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Please merge this to M60 ASAP. branch:3112

Comment 24 by estade@google.com, Jul 10 2017

Status: Fixed (was: Started)
sorry, I've been ooo. Merged just now.
Project Member

Comment 25 by bugdroid1@chromium.org, Jul 10 2017

Labels: -merge-approved-60 merge-merged-3112
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6c6ae718a608333d1954682b88e9988f51d64be7

commit 6c6ae718a608333d1954682b88e9988f51d64be7
Author: Evan Stade <estade@chromium.org>
Date: Mon Jul 10 16:23:25 2017

Linux: Improve avatar button for themed browser windows.

1. Draw fill color/image on avatar button. Some themes use a color,
   some have an image, or they can have both.
2. Make generic avatar icon white with a grey outline, just like the
   caption button icons.

BUG= 722595 
TBR=estade@chromium.org

(cherry picked from commit 0b5abf2881817f9cba31ac3d6ba7d50d01924d78)

Change-Id: Ie05f2de9e677be2f04190ef8043e62bc4c1a7d73
Reviewed-on: https://chromium-review.googlesource.com/514448
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#475013}
Reviewed-on: https://chromium-review.googlesource.com/565105
Reviewed-by: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/branch-heads/3112@{#556}
Cr-Branched-From: b6460e24cf59f429d69de255538d0fc7a425ccf9-refs/heads/master@{#474897}
[modify] https://crrev.com/6c6ae718a608333d1954682b88e9988f51d64be7/chrome/app/vector_icons/BUILD.gn
[add] https://crrev.com/6c6ae718a608333d1954682b88e9988f51d64be7/chrome/app/vector_icons/profile_switcher_outline.icon
[modify] https://crrev.com/6c6ae718a608333d1954682b88e9988f51d64be7/chrome/browser/ui/views/profiles/avatar_button.cc

Labels: Needs-Feedback
Tested this issue on Ubuntu 14.04 with chrome #60.0.3112.66, observed that avatar icon is filled  with white color, 

Attaching the screenshot for reference.

estade@ could you please look into it and confirm that this is the expected behavior of this fix.
Issue 722595.png
32.4 KB View Download
Status: Verified (was: Fixed)
lgtm

Sign in to add a comment