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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 1978943002: [MD] Fix detached bookmark bar top separator in hdpi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iterate on comment 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 | « chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index f5e3a021bbe8af199adecd922f74adf77ba9ddf4..ed2a15b0a540184875beb7d65bec8ef929c11ae2 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -217,12 +217,21 @@ void PaintDetachedBookmarkBar(gfx::Canvas* canvas,
BookmarkBarView* view) {
// Paint background for detached state; if animating, this is fade in/out.
const ui::ThemeProvider* tp = view->GetThemeProvider();
+ gfx::Rect fill_rect = view->GetLocalBounds();
+ // In MD, we have to not color the top 1dp, because that should be painted by
+ // the toolbar. We will, however, paint the 1px separator at the bottom of the
+ // first dp. See crbug.com/610359
+ if (ui::MaterialDesignController::IsModeMaterial())
+ fill_rect.Inset(0, 1, 0, 0);
+
// In detached mode, the bar is meant to overlap with |contents_container_|.
- // Since the layer for |view| is opaque, we have to recreate that base color
- // here. (The detached background color may be partially transparent.)
- canvas->DrawColor(
- tp->GetColor(ThemeProperties::COLOR_CONTROL_BACKGROUND));
- canvas->DrawColor(
+ // The detached background color may be partially transparent, but the layer
+ // for |view| must be painted opaquely to avoid subpixel anti-aliasing
+ // artifacts, so we recreate the contents container base color here.
+ canvas->FillRect(fill_rect,
+ tp->GetColor(ThemeProperties::COLOR_CONTROL_BACKGROUND));
+ canvas->FillRect(
+ fill_rect,
tp->GetColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_BACKGROUND));
// Draw the separators above and below bookmark bar;
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698