Commit 493e5ff7 authored by xiaolingbao's avatar xiaolingbao Committed by Commit bot

Left align bubble title and text, adjusted spacing between.

BUG=462407

Review URL: https://codereview.chromium.org/962013002

Cr-Commit-Position: refs/heads/master@{#318571}
parent b3002837
...@@ -35,7 +35,10 @@ const int kMaxBubbleViewWidth = 262; ...@@ -35,7 +35,10 @@ const int kMaxBubbleViewWidth = 262;
// The vertical inset of the wrench bubble anchor from the wrench menu button. // The vertical inset of the wrench bubble anchor from the wrench menu button.
const int kAnchorVerticalInset = 5; const int kAnchorVerticalInset = 5;
const int kBubblePadding = 6; const int kBubblePadding = 19;
// Spacing between bubble text and buttons.
const int kLabelToButtonVerticalSpacing = 14;
} // namespace } // namespace
...@@ -67,6 +70,10 @@ GlobalErrorBubbleView::GlobalErrorBubbleView( ...@@ -67,6 +70,10 @@ GlobalErrorBubbleView::GlobalErrorBubbleView(
: BubbleDelegateView(anchor_view, arrow), : BubbleDelegateView(anchor_view, arrow),
browser_(browser), browser_(browser),
error_(error) { error_(error) {
// Set content margins to left-align the bubble text with the title.
// BubbleFrameView adds enough padding below title, no top padding needed.
set_margins(gfx::Insets(0, kBubblePadding, kBubblePadding, kBubblePadding));
// Compensate for built-in vertical padding in the anchor view's image. // Compensate for built-in vertical padding in the anchor view's image.
set_anchor_view_insets( set_anchor_view_insets(
gfx::Insets(kAnchorVerticalInset, 0, kAnchorVerticalInset, 0)); gfx::Insets(kAnchorVerticalInset, 0, kAnchorVerticalInset, 0));
...@@ -105,9 +112,6 @@ GlobalErrorBubbleView::GlobalErrorBubbleView( ...@@ -105,9 +112,6 @@ GlobalErrorBubbleView::GlobalErrorBubbleView(
views::GridLayout* layout = new views::GridLayout(this); views::GridLayout* layout = new views::GridLayout(this);
SetLayoutManager(layout); SetLayoutManager(layout);
// BubbleFrameView adds enough padding below title, no top padding needed.
layout->SetInsets(0, kBubblePadding, kBubblePadding, kBubblePadding);
// First row, message labels. // First row, message labels.
views::ColumnSet* cs = layout->AddColumnSet(0); views::ColumnSet* cs = layout->AddColumnSet(0);
cs->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, cs->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL,
...@@ -130,7 +134,7 @@ GlobalErrorBubbleView::GlobalErrorBubbleView( ...@@ -130,7 +134,7 @@ GlobalErrorBubbleView::GlobalErrorBubbleView(
if (i < message_labels.size() - 1) if (i < message_labels.size() - 1)
layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
} }
layout->AddPaddingRow(0, views::kLabelToControlVerticalSpacing); layout->AddPaddingRow(0, kLabelToButtonVerticalSpacing);
layout->StartRow(0, 1); layout->StartRow(0, 1);
layout->AddView(accept_button.release()); layout->AddView(accept_button.release());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment