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

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

Issue 18083014: Create new look of the avatar label. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix font size issue and some more positioning. Created 7 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/browser_non_client_frame_view_ash.cc
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
index 523a456b84c6dc2b6ae74e53b46f553229e88ada..6574dd3684983beb61cf70c0deec5a4c22ea34cc 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
@@ -132,12 +132,14 @@ gfx::Rect BrowserNonClientFrameViewAsh::GetBoundsForTabStrip(
BrowserNonClientFrameView::TabStripInsets
BrowserNonClientFrameViewAsh::GetTabStripInsets(bool force_restored) const {
- int left = avatar_button() ? kAvatarSideSpacing +
- browser_view()->GetOTRAvatarIcon().width() + kAvatarSideSpacing :
- kTabstripLeftSpacing;
- if (avatar_label()) {
- left += avatar_label()->GetPreferredSize().width() +
- views::kRelatedControlHorizontalSpacing;
+ int left = kTabstripLeftSpacing;
+ if (avatar_button()) {
+ if (avatar_label()) {
+ left = avatar_label()->GetPreferredSize().width() - 6;
+ } else {
+ left = kAvatarSideSpacing + browser_view()->GetOTRAvatarIcon().width() +
+ kAvatarSideSpacing;
+ }
}
int right = frame_painter_->GetRightInset() + kTabstripRightSpacing;
return TabStripInsets(NonClientTopBorderHeight(force_restored), left, right);
@@ -441,8 +443,8 @@ void BrowserNonClientFrameViewAsh::LayoutAvatar() {
gfx::Size size = avatar_label()->GetPreferredSize();
int label_height = std::min(avatar_bounds.height(), size.height());
gfx::Rect label_bounds(
- avatar_bounds.right() + views::kRelatedControlHorizontalSpacing,
- avatar_y + (avatar_bounds.height() - label_height) / 2,
+ 0,
+ avatar_bottom - size.height() - 3,
size.width(),
size.height());
avatar_label()->SetBoundsRect(label_bounds);

Powered by Google App Engine
This is Rietveld 408576698