Commit 0b0d0625 authored by David Black's avatar David Black Committed by Commit Bot

Fix line wrapping.

Line length should not exceed 376dip and should have a line height of
24dip.

See bug for spec/demo.

Bug: b:112597108
Change-Id: Ic0b920d33bc0d571b98f7622a0e9d0fb965c74f1
Reviewed-on: https://chromium-review.googlesource.com/1175057Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/master@{#583080}
parent 5f4706af
......@@ -27,7 +27,7 @@ namespace {
// Appearance.
constexpr int kIconSizeDip = 24;
constexpr int kLineHeightDip = 24;
constexpr int kMaxWidthDip = 512;
constexpr int kMaxWidthDip = 452;
constexpr int kPaddingLeftDip = 12;
constexpr int kPaddingRightDip = 24;
constexpr int kPreferredHeightDip = 48;
......
......@@ -16,6 +16,8 @@ namespace ash {
namespace {
// Appearance.
constexpr int kLineHeightDip = 24;
constexpr int kMaxWidthDip = 376;
constexpr int kMinHeightDip = 32;
// Helpers ---------------------------------------------------------------------
......@@ -39,7 +41,7 @@ AssistantQueryView::AssistantQueryView() {
AssistantQueryView::~AssistantQueryView() = default;
gfx::Size AssistantQueryView::CalculatePreferredSize() const {
return gfx::Size(INT_MAX, GetHeightForWidth(INT_MAX));
return gfx::Size(kMaxWidthDip, GetHeightForWidth(kMaxWidthDip));
}
int AssistantQueryView::GetHeightForWidth(int width) const {
......@@ -69,6 +71,7 @@ void AssistantQueryView::InitLayout() {
label_ = new views::StyledLabel(base::string16(), /*listener=*/nullptr);
label_->set_auto_color_readability_enabled(false);
label_->SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_CENTER);
label_->SetLineHeight(kLineHeightDip);
AddChildView(label_);
}
......
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