Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1130)

Unified Diff: chrome/browser/ui/views/find_bar_view.cc

Issue 516943003: Add textfield internal padding from FocusableBorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments; fix find bar offset. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/find_bar_view.cc
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc
index 7ec9e1a93d6c4e15d57bd1064a3c529d0989229e..6441250c2c3f6da708bb6f62d1083d7afab13b79 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -325,10 +325,11 @@ void FindBarView::Layout() {
sz.width(), sz.height());
// And whatever space is left in between, gets filled up by the find edit box.
- int find_text_width = std::max(0, match_count_x -
- kMarginLeftOfMatchCountLabel - kMarginLeftOfFindTextfield);
- find_text_->SetBounds(kMarginLeftOfFindTextfield, find_text_y,
- find_text_width, find_text_->GetPreferredSize().height());
+ int left_margin = kMarginLeftOfFindTextfield - views::Textfield::kTextPadding;
Peter Kasting 2014/08/30 00:46:42 The changes here and below look like they only acc
msw 2014/09/04 01:25:51 Done, but that necessitates increasing kMarginLeft
+ int find_text_width =
+ std::max(0, match_count_x - left_margin - kMarginLeftOfMatchCountLabel);
+ find_text_->SetBounds(left_margin, find_text_y, find_text_width,
+ find_text_->GetPreferredSize().height());
// The focus forwarder view is a hidden view that should cover the area
// between the find text box and the find button so that when the user clicks
@@ -345,9 +346,10 @@ gfx::Size FindBarView::GetPreferredSize() const {
prefsize.set_height(preferred_height_);
// Add up all the preferred sizes and margins of the rest of the controls.
- prefsize.Enlarge(kMarginLeftOfCloseButton + kMarginRightOfCloseButton +
- kMarginLeftOfFindTextfield,
- 0);
+ prefsize.Enlarge(
+ kMarginLeftOfCloseButton + kMarginRightOfCloseButton +
+ kMarginLeftOfFindTextfield - views::Textfield::kTextPadding,
+ 0);
prefsize.Enlarge(find_previous_button_->GetPreferredSize().width(), 0);
prefsize.Enlarge(find_next_button_->GetPreferredSize().width(), 0);
prefsize.Enlarge(close_button_->GetPreferredSize().width(), 0);

Powered by Google App Engine
This is Rietveld 408576698