Index: athena/home/athena_start_page_view.cc |
diff --git a/athena/home/athena_start_page_view.cc b/athena/home/athena_start_page_view.cc |
index f15e46b4b5b42eb2576eef78e26bf4839b93c2fb..71d79f57a695328d3d4d57156c18bc17d16d2682 100644 |
--- a/athena/home/athena_start_page_view.cc |
+++ b/athena/home/athena_start_page_view.cc |
@@ -40,7 +40,7 @@ const int kWebViewWidth = 500; |
const int kWebViewHeight = 105; |
const int kSearchBoxBorderWidth = 1; |
const int kSearchBoxCornerRadius = 2; |
-const int kSearchBoxWidth = 490; |
+const int kSearchBoxWidth = kIconSize * 6 + kIconMargin * 7; |
oshima
2014/08/28 20:44:51
can you document this logic?
Jun Mukai
2014/08/28 21:55:36
Done.
|
const int kSearchBoxHeight = 40; |
class PlaceHolderButton : public views::ImageButton, |
@@ -257,7 +257,10 @@ AthenaStartPageView::LayoutData AthenaStartPageView::CreateBottomBounds( |
state.controls.set_x(width - kIconMargin - state.controls.width()); |
state.controls.set_y(kIconMargin); |
- state.search_box.set_size(search_box_container_->size()); |
+ int search_box_max_width = |
+ state.controls.x() - state.icons.right() - kIconMargin * 2; |
+ state.search_box.set_width(std::min(search_box_max_width, kSearchBoxWidth)); |
+ state.search_box.set_height(search_box_container_->height()); |
state.search_box.set_x((width - state.search_box.width()) / 2); |
state.search_box.set_y((kHomeCardHeight - state.search_box.height()) / 2); |
@@ -270,7 +273,7 @@ AthenaStartPageView::LayoutData AthenaStartPageView::CreateCenteredBounds( |
int width) { |
LayoutData state; |
- state.search_box.set_size(search_box_container_->size()); |
+ state.search_box.set_size(search_box_container_->GetPreferredSize()); |
state.search_box.set_x((width - state.search_box.width()) / 2); |
state.search_box.set_y(logo_->bounds().bottom() + kInstantContainerSpacing); |