Commit 3f501e0c authored by Melissa Zhang's avatar Melissa Zhang Committed by Commit Bot

[Sharesheet] Fix target text height.

This CL fixes a bug where sometimes target text height
obscures a section of the text.

Bug: 1097623
Change-Id: I70c4841de68a831f13bd074c1a9bff569a779500
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2399164Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Melissa Zhang <melzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805569}
parent fcf9348a
......@@ -41,7 +41,10 @@ namespace {
constexpr int kButtonWidth = 92;
// kButtonHeight = 88px height + 2*8px for padding on top and bottom.
constexpr int kButtonHeight = 104;
// kButtonTextMaxWidth is button max width without padding.
constexpr int kButtonTextMaxWidth = 76;
constexpr int kButtonLineHeight = 20;
constexpr int kButtonMaxLines = 2;
constexpr int kButtonPadding = 8;
constexpr int kBubbleTopPaddingFromWindow = 36;
......@@ -113,6 +116,7 @@ class ShareSheetTargetButton : public views::Button {
// If there is no secondary label, let the initial label stretch across
// multiple lines.
label->SetMultiLine(true);
label->SetMaxLines(kButtonMaxLines);
}
AddChildView(std::move(label_view));
......@@ -125,6 +129,7 @@ class ShareSheetTargetButton : public views::Button {
void SetLabelProperties(views::Label* label) {
label->SetLineHeight(kButtonLineHeight);
label->SetMaximumWidth(kButtonTextMaxWidth);
label->SetBackgroundColor(SK_ColorTRANSPARENT);
label->SetHandlesTooltips(true);
label->SetTooltipText(label->GetText());
......
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