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

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

Issue 1817253003: [MD] Use same focus ring on BarControlButton as MdTextButton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update docs Created 4 years, 9 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 40b16b7009903039c3a98002940b58c329edae42..0420d9abb2e61873fd09997d3de7509b6c64d7e3 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -332,35 +332,30 @@ void FindBarView::Layout() {
if (view_width && view_width < panel_width)
panel_width = view_width;
- // First we draw the close button on the far right.
- gfx::Size sz = close_button_->GetPreferredSize();
- close_button_->SetBounds(panel_width - sz.width() -
- kMarginRightOfCloseButton,
- (height() - sz.height()) / 2,
- sz.width(),
- sz.height());
// Set the color.
OnThemeChanged();
- // Next, the FindNext button to the left the close button.
- sz = find_next_button_->GetPreferredSize();
- find_next_button_->SetBounds(close_button_->x() -
- find_next_button_->width() -
- kMarginLeftOfCloseButton,
- (height() - sz.height()) / 2,
- sz.width(),
- sz.height());
-
- // Then, the FindPrevious button to the left the FindNext button.
- sz = find_previous_button_->GetPreferredSize();
- find_previous_button_->SetBounds(find_next_button_->x() -
- find_previous_button_->width(),
- (height() - sz.height()) / 2,
- sz.width(),
- sz.height());
+ // First we position the close button on the far right.
+ close_button_->SizeToPreferredSize();
+ close_button_->SetPosition(gfx::Point(
+ panel_width - close_button_->width() - kMarginRightOfCloseButton,
+ (height() - close_button_->height()) / 2));
+
+ // Then, the next button to the left of the close button.
+ find_next_button_->SizeToPreferredSize();
+ find_next_button_->SetPosition(
+ gfx::Point(close_button_->x() - find_next_button_->width() -
+ kMarginLeftOfCloseButton,
+ (height() - find_next_button_->height()) / 2));
+
+ // Then, the previous button to the left of the next button.
+ find_previous_button_->SizeToPreferredSize();
+ find_previous_button_->SetPosition(gfx::Point(
+ find_next_button_->x() - find_previous_button_->width(),
+ (height() - find_previous_button_->height()) / 2));
// Then the label showing the match count number.
- sz = match_count_text_->GetPreferredSize();
+ gfx::Size sz = match_count_text_->GetPreferredSize();
// We extend the label bounds a bit to give the background highlighting a
// bit of breathing room (margins around the text).
sz.Enlarge(kMatchCountExtraWidth, 0);
« no previous file with comments | « chrome/browser/ui/views/download/download_shelf_view.cc ('k') | chrome/browser/ui/views/infobars/infobar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698