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

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: Removed floor and rebased 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 0153322ed673a2a0158c123ed12994b07eb19040..7b54be64a7f946d78d394a99db69e9f0f9a002b0 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -1706,11 +1706,12 @@ 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 =
+ (current_profile_photo->GetPreferredSize().height() -
+ 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 =
@@ -1748,6 +1749,12 @@ views::View* ProfileChooserView::CreateMaterialDesignCurrentProfileView(
email_label->SetElideBehavior(gfx::ELIDE_EMAIL);
email_label->SetEnabled(false);
email_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
+ name_container_v_spacing =
+ (current_profile_photo->GetPreferredSize().height() -
+ 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