Commit 74dcc581 authored by David Black's avatar David Black Committed by Commit Bot

UI polish for Assistant.

Fixes two UI issues:
1. "Nothing found on screen" card was still being clipped despite using
    border-box box-sizing. Because the border is 1px wide, this is
    probably caused by pixel rounding when we size our WebView. To work
    around this we will just add a slight margin to the card to ensure
    the border is drawn within WebView bounds.
2.  When changing screen resolution with the UI open, multiline labels
    would sometimes not be bounded correctly. To address this, we make
    sure that the Label width matches parent width. We accomplish this
    by using STRETCH cross axis alignment on the box layout (which is
    default cross axis alignment).

Bug: b:116001082, b:115585763
Change-Id: Iec80955e45011d73816978c43ddf1235e49b476d
Reviewed-on: https://chromium-review.googlesource.com/1241470
Commit-Queue: David Black <dmblack@google.com>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593744}
parent cd312e01
...@@ -258,15 +258,11 @@ void UiElementContainerView::PreferredSizeChanged() { ...@@ -258,15 +258,11 @@ void UiElementContainerView::PreferredSizeChanged() {
} }
void UiElementContainerView::InitLayout() { void UiElementContainerView::InitLayout() {
views::BoxLayout* layout_manager =
content_view()->SetLayoutManager(std::make_unique<views::BoxLayout>( content_view()->SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kVertical, views::BoxLayout::Orientation::kVertical,
gfx::Insets(0, kPaddingHorizontalDip, kPaddingBottomDip, gfx::Insets(0, kPaddingHorizontalDip, kPaddingBottomDip,
kPaddingHorizontalDip), kPaddingHorizontalDip),
kSpacingDip)); kSpacingDip));
layout_manager->set_cross_axis_alignment(
views::BoxLayout::CrossAxisAlignment::CROSS_AXIS_ALIGNMENT_START);
} }
void UiElementContainerView::OnCommittedQueryChanged( void UiElementContainerView::OnCommittedQueryChanged(
......
...@@ -353,7 +353,6 @@ void AssistantManagerServiceImpl::OnShowContextualQueryFallback() { ...@@ -353,7 +353,6 @@ void AssistantManagerServiceImpl::OnShowContextualQueryFallback() {
<body> <body>
<style> <style>
* { * {
box-sizing: border-box;
cursor: default; cursor: default;
font-family: Google Sans, sans-serif; font-family: Google Sans, sans-serif;
user-select: none; user-select: none;
...@@ -364,6 +363,7 @@ void AssistantManagerServiceImpl::OnShowContextualQueryFallback() { ...@@ -364,6 +363,7 @@ void AssistantManagerServiceImpl::OnShowContextualQueryFallback() {
border-radius: 12px; border-radius: 12px;
color: #5F6368; color: #5F6368;
font-size: 13px; font-size: 13px;
margin: 1px;
padding: 16px; padding: 16px;
text-align: center; text-align: center;
} }
......
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