Commit 986629bb authored by Weidong Guo's avatar Weidong Guo Committed by Commit Bot

Fix search box alignment issue

Changes:
Change the spacing between icon and textfield from 12 to 16 when search
box is opened to align query with search results.

Bug: 844182
Change-Id: Ie0715fd758226010342410179e1fbc0a1224856b
Reviewed-on: https://chromium-review.googlesource.com/c/1327536Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606714}
parent 8ea18f74
......@@ -288,12 +288,12 @@ void SearchBoxView::UpdateBackground(double progress,
void SearchBoxView::UpdateLayout(double progress,
ash::AppListState current_state,
ash::AppListState target_state) {
const int horizontal_spacing = gfx::Tween::LinearIntValueBetween(
progress, GetBoxLayoutPaddingForState(current_state),
GetBoxLayoutPaddingForState(target_state));
box_layout()->set_inside_border_insets(
gfx::Insets(0,
gfx::Tween::LinearIntValueBetween(
progress, GetBoxLayoutPaddingForState(current_state),
GetBoxLayoutPaddingForState(target_state)),
0, 0));
gfx::Insets(0, horizontal_spacing, 0, 0));
box_layout()->set_between_child_spacing(horizontal_spacing);
if (show_assistant_button()) {
assistant_button()->layer()->SetOpacity(gfx::Tween::LinearIntValueBetween(
progress, GetAssistantButtonOpacityForState(current_state),
......
......@@ -15,7 +15,7 @@
namespace gfx {
class Rect;
class Size;
}
} // namespace gfx
namespace views {
......@@ -129,6 +129,10 @@ class VIEWS_EXPORT BoxLayout : public LayoutManager {
minimum_cross_axis_size_ = size;
}
void set_between_child_spacing(int spacing) {
between_child_spacing_ = spacing;
}
// Sets the flex weight for the given |view|. Using the preferred size as
// the basis, free space along the main axis is distributed to views in the
// ratio of their flex weights. Similarly, if the views will overflow the
......@@ -307,7 +311,7 @@ class VIEWS_EXPORT BoxLayout : public LayoutManager {
gfx::Insets inside_border_insets_;
// Spacing to put in between child views.
const int between_child_spacing_;
int between_child_spacing_;
// The alignment of children in the main axis. This is
// MAIN_AXIS_ALIGNMENT_START by default.
......@@ -335,6 +339,6 @@ class VIEWS_EXPORT BoxLayout : public LayoutManager {
DISALLOW_IMPLICIT_CONSTRUCTORS(BoxLayout);
};
} // namespace views
} // namespace views
#endif // UI_VIEWS_LAYOUT_BOX_LAYOUT_H_
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