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

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 2230963004: [MD User Menu] Un-hardcode profile card's spacing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/profiles/profile_chooser_view.cc
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
index 395783601cd5ca91555ac46453564043d446bc6a..a202df9d32b27ed7b15d7ee04dc47c61b230ff8a 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -1696,11 +1696,13 @@ views::View* ProfileChooserView::CreateMaterialDesignCurrentProfileView(
current_profile_name->SetHorizontalAlignment(gfx::ALIGN_LEFT);
NonInteractiveContainer* profile_name_container =
new NonInteractiveContainer();
- int name_container_v_spacing = views::kRelatedControlVerticalSpacing;
- if (!avatar_item.signed_in || switches::IsEnableAccountConsistency())
- name_container_v_spacing += views::kRelatedControlVerticalSpacing;
- profile_name_container->SetLayoutManager(new views::BoxLayout(
- views::BoxLayout::kVertical, 0, name_container_v_spacing, 0));
+ int name_container_v_spacing =
+ std::floor((current_profile_photo->GetPreferredSize().height() -
sky 2016/08/24 19:40:54 Do you really need the floor here? Don't you get w
Jane 2016/08/24 19:54:34 It's for just in case that the divided value has a
sky 2016/08/24 20:29:12 You're setting this to an int, so it's going to be
Jane 2016/08/24 20:35:17 Oh oops, sorry totally forgot!
+ current_profile_name->GetPreferredSize().height()) /
+ 2);
+ views::BoxLayout* profile_name_layout = new views::BoxLayout(
+ views::BoxLayout::kVertical, 0, name_container_v_spacing, 0);
+ profile_name_container->SetLayoutManager(profile_name_layout);
profile_name_container->AddChildView(current_profile_name);
const int between_child_spacing =
@@ -1738,6 +1740,13 @@ views::View* ProfileChooserView::CreateMaterialDesignCurrentProfileView(
email_label->SetElideBehavior(gfx::ELIDE_EMAIL);
email_label->SetEnabled(false);
email_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
+ name_container_v_spacing =
+ std::floor((current_profile_photo->GetPreferredSize().height() -
sky 2016/08/24 19:40:54 Same comment here.
Jane 2016/08/24 20:35:17 Done.
+ current_profile_name->GetPreferredSize().height() -
+ email_label->GetPreferredSize().height()) /
+ 2);
+ profile_name_layout->set_inside_border_insets(
+ gfx::Insets(name_container_v_spacing, 0));
profile_name_container->AddChildView(email_label);
}
return view;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698