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

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

Issue 297143008: [Win] UI fixes for the new avatar button/bubble auth errors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix avatar buttons + redo the bubble warning icon Created 6 years, 6 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
Index: chrome/browser/ui/views/frame/glass_browser_frame_view.cc
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
index 1402b157bcf56ab927d9f5585652ac2faa61d94f..7719d5053a195022e1ac0bf86afa0e039764d17c 100644
--- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
@@ -446,6 +446,10 @@ void GlassBrowserFrameView::LayoutNewStyleAvatar() {
if (!new_avatar_button())
return;
+ // We need to offset the button correctly in maximized mode, so that the
+ // custom glass style aligns with the native control glass style. Determined
+ // by visual inspection.
+ const int maximized_frame_offset = 7;
msw 2014/06/09 21:42:40 This should probably be determined by some NonClie
noms (inactive) 2014/06/18 18:07:24 Done! I've cleaned up the code a bit too. There's
gfx::Size label_size = new_avatar_button()->GetPreferredSize();
int button_size_with_offset = kNewAvatarButtonOffset + label_size.width();
@@ -454,11 +458,13 @@ void GlassBrowserFrameView::LayoutNewStyleAvatar() {
if (base::i18n::IsRTL())
button_x = width() - frame()->GetMinimizeButtonOffset() +
kNewAvatarButtonOffset;
- int button_y = frame()->IsMaximized() ? NonClientTopBorderHeight() : 1;
+ int button_y = frame()->IsMaximized() ? maximized_frame_offset : 1;
- // If the window is maximized, the button is 2 pixels too tall. Determined
- // via visual inspection.
- int height_to_subtract = frame()->IsMaximized() ? 2 : 0;
+ // If the window is maximized, we need to subtract the previously added
+ // offset, plus an extra pixel which makes the button too tall. The latter
+ // was determined by visual inspection.
+ int height_to_subtract =
+ frame()->IsMaximized() ? maximized_frame_offset - 1 : 0;
new_avatar_button()->SetBounds(
button_x,

Powered by Google App Engine
This is Rietveld 408576698