diff options
author | stevet@google.com <stevet@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-10 18:31:08 +0000 |
---|---|---|
committer | stevet@google.com <stevet@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-10 18:31:08 +0000 |
commit | b3c59cc5ad40bd08847ba6af0e61b27a70c54812 (patch) | |
tree | 70a1b5c7971a45365c2c5bb5aed52f30fef933bf | |
parent | 514b2dc65597f025ff1e58193fb707891e6aa3bb (diff) | |
download | chromium_src-b3c59cc5ad40bd08847ba6af0e61b27a70c54812.zip chromium_src-b3c59cc5ad40bd08847ba6af0e61b27a70c54812.tar.gz chromium_src-b3c59cc5ad40bd08847ba6af0e61b27a70c54812.tar.bz2 |
Extended the click hit-box of the Wrench/AppMenu button to the edge of the window when maximized, as per Fitt's Law.
BUG=54291
TEST=Ensure that if the Chrome window is maximized, if the mouse cursor is to the right of the Wrench button (all the way against the edge of the screen) it can still click on the button (with all the correct visual cues).
Review URL: http://codereview.chromium.org/6250161
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74456 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/views/toolbar_view.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc index dde2083..2c7cf8d9 100644 --- a/chrome/browser/ui/views/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar_view.cc @@ -506,8 +506,9 @@ void ToolbarView::Layout() { if (back_ == NULL) return; + bool maximized = browser_->window() && browser_->window()->IsMaximized(); if (!IsDisplayModeNormal()) { - int edge_width = (browser_->window() && browser_->window()->IsMaximized()) ? + int edge_width = maximized ? 0 : kPopupBackgroundEdge->width(); // See Paint(). location_bar_->SetBounds(edge_width, PopupTopSpacing(), width() - (edge_width * 2), location_bar_->GetPreferredSize().height()); @@ -527,7 +528,7 @@ void ToolbarView::Layout() { // Layout() in this case. // http://crbug.com/5540 int back_width = back_->GetPreferredSize().width(); - if (browser_->window() && browser_->window()->IsMaximized()) + if (maximized) back_->SetBounds(0, child_y, back_width + kEdgeSpacing, child_height); else back_->SetBounds(kEdgeSpacing, child_y, back_width, child_height); @@ -574,6 +575,10 @@ void ToolbarView::Layout() { // required. browser_actions_->Layout(); + // Extend the app menu to the screen's right edge in maximized mode just like + // we extend the back button to the left edge. + if (maximized) + app_menu_width += kEdgeSpacing; #if defined(OS_CHROMEOS) feedback_->SetBounds(browser_actions_->x() + browser_actions_width, child_y, feedback_->GetPreferredSize().width(), child_height); |