diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-27 17:58:51 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-27 17:58:51 +0000 |
commit | 7bec38ffd30d77bab8e86aecca39f665d50eaa13 (patch) | |
tree | cefeb6a0b2537e3a52a5db6b9e4953990abc5610 /chrome/browser/views/toolbar_view.cc | |
parent | c3287b7a53a785756206c447bd7d356db6796220 (diff) | |
download | chromium_src-7bec38ffd30d77bab8e86aecca39f665d50eaa13.zip chromium_src-7bec38ffd30d77bab8e86aecca39f665d50eaa13.tar.gz chromium_src-7bec38ffd30d77bab8e86aecca39f665d50eaa13.tar.bz2 |
Make popups closer to pixel-perfect. The main problem is that the toolbar is constrained to the width of the client area, when it actually needs to extend out two pixesl on each side into the current nonclient area. I don't have a good fix for this, hoping Ben comes up with a brilliant idea.
BUG=5054
Review URL: http://codereview.chromium.org/18799
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8726 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/toolbar_view.cc')
-rw-r--r-- | chrome/browser/views/toolbar_view.cc | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index f6ed905..18922dd 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -22,6 +22,7 @@ #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/user_data_manager.h" #include "chrome/browser/views/dom_view.h" +#include "chrome/browser/views/frame/browser_view.h" #include "chrome/browser/views/go_button.h" #include "chrome/browser/views/location_bar_view.h" #include "chrome/browser/views/theme_helpers.h" @@ -48,9 +49,6 @@ static const int kControlHorizOffset = 4; static const int kControlVertOffset = 6; -static const int kControlVertOffsetLocationOnly = 4; -// The left and right margin of the toolbar in location-bar only mode. -static const int kToolbarHorizontalMargin = 1; static const int kControlIndent = 3; static const int kStatusBubbleWidth = 480; @@ -319,11 +317,8 @@ void BrowserToolbarView::Layout() { left_side_width = star_->x() + star_->width(); } else { - gfx::Size temp = location_bar_->GetPreferredSize(); - location_bar_height = temp.height(); - left_side_width = kToolbarHorizontalMargin; - right_side_width = kToolbarHorizontalMargin; - location_bar_y = kControlVertOffsetLocationOnly; + location_bar_height = location_bar_->GetPreferredSize().height(); + location_bar_y = 0; } location_bar_->SetBounds(left_side_width, location_bar_y, @@ -484,8 +479,11 @@ gfx::Size BrowserToolbarView::GetPreferredSize() { return gfx::Size(0, normal_background.height()); } - int locbar_height = location_bar_->GetPreferredSize().height(); - return gfx::Size(0, locbar_height + 2 * kControlVertOffsetLocationOnly); + int client_edge_height = + (browser_->window() && !browser_->window()->IsMaximized()) ? + BrowserView::kClientEdgeThickness : 0; + return gfx::Size(0, + location_bar_->GetPreferredSize().height() + client_edge_height); } void BrowserToolbarView::RunPageMenu(const CPoint& pt, HWND hwnd) { |