diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-08 23:17:41 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-08 23:17:41 +0000 |
commit | 0826f20917f3362ac12e52d304c7b2ae56a588b0 (patch) | |
tree | b76f4002242a3555e2a57b1cd4acc201346c745e /chrome/browser/views | |
parent | b8ab654da215567c8292b2abeac6c8d972aa1cfb (diff) | |
download | chromium_src-0826f20917f3362ac12e52d304c7b2ae56a588b0.zip chromium_src-0826f20917f3362ac12e52d304c7b2ae56a588b0.tar.gz chromium_src-0826f20917f3362ac12e52d304c7b2ae56a588b0.tar.bz2 |
More tweaks to the frames. Provide proper layout for the title bar in app mode.
B=1031854
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@605 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/frame/browser_view2.cc | 26 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_frame.cc | 8 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_frame.h | 4 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_non_client_view.cc | 16 |
4 files changed, 33 insertions, 21 deletions
diff --git a/chrome/browser/views/frame/browser_view2.cc b/chrome/browser/views/frame/browser_view2.cc index 2ecafaa..518134b 100644 --- a/chrome/browser/views/frame/browser_view2.cc +++ b/chrome/browser/views/frame/browser_view2.cc @@ -647,19 +647,21 @@ int BrowserView2::LayoutToolbar(int top) { } int BrowserView2::LayoutBookmarkAndInfoBars(int top) { - // If we have an Info-bar showing, and we're showing the New Tab Page, and - // the Bookmark bar isn't visible on all tabs, then we need to show the Info - // bar _above_ the Bookmark bar, since the Bookmark bar is styled to look - // like it's part of the New Tab Page... - if (active_info_bar_ && active_bookmark_bar_ && - bookmark_bar_view_->IsNewTabPage() && - !bookmark_bar_view_->IsAlwaysShown()) { - top = LayoutInfoBar(top); - return LayoutBookmarkBar(top); + if (SupportsWindowFeature(FEATURE_BOOKMARKBAR)) { + // If we have an Info-bar showing, and we're showing the New Tab Page, and + // the Bookmark bar isn't visible on all tabs, then we need to show the + // Info bar _above_ the Bookmark bar, since the Bookmark bar is styled to + // look like it's part of the New Tab Page... + if (active_info_bar_ && active_bookmark_bar_ && + bookmark_bar_view_->IsNewTabPage() && + !bookmark_bar_view_->IsAlwaysShown()) { + top = LayoutInfoBar(top); + return LayoutBookmarkBar(top); + } + // Otherwise, Bookmark bar first, Info bar second. + top -= kSeparationLineHeight; + top = LayoutBookmarkBar(top); } - // Otherwise, Bookmark bar first, Info bar second. - top -= kSeparationLineHeight; - top = LayoutBookmarkBar(top); return LayoutInfoBar(top); } diff --git a/chrome/browser/views/frame/opaque_frame.cc b/chrome/browser/views/frame/opaque_frame.cc index 1d4a46d..c028624 100644 --- a/chrome/browser/views/frame/opaque_frame.cc +++ b/chrome/browser/views/frame/opaque_frame.cc @@ -47,6 +47,14 @@ OpaqueFrame::OpaqueFrame(BrowserView2* browser_view) OpaqueFrame::~OpaqueFrame() { } +bool OpaqueFrame::IsTabStripVisible() const { + return browser_view_->IsTabStripVisible(); +} + +bool OpaqueFrame::IsToolbarVisible() const { + return browser_view_->IsToolbarVisible(); +} + gfx::Rect OpaqueFrame::GetToolbarBounds() const { return browser_view_->GetToolbarBounds(); } diff --git a/chrome/browser/views/frame/opaque_frame.h b/chrome/browser/views/frame/opaque_frame.h index ddd1c77..ebb5a20 100644 --- a/chrome/browser/views/frame/opaque_frame.h +++ b/chrome/browser/views/frame/opaque_frame.h @@ -54,8 +54,8 @@ class OpaqueFrame : public BrowserFrame, explicit OpaqueFrame(BrowserView2* browser_view); virtual ~OpaqueFrame(); - bool IsToolbarVisible() const { return true; } - bool IsTabStripVisible() const { return true; } + bool IsToolbarVisible() const; + bool IsTabStripVisible() const; // Returns bounds of various areas within the BrowserView ClientView. gfx::Rect GetToolbarBounds() const; diff --git a/chrome/browser/views/frame/opaque_non_client_view.cc b/chrome/browser/views/frame/opaque_non_client_view.cc index 599380a..a64ebdf 100644 --- a/chrome/browser/views/frame/opaque_non_client_view.cc +++ b/chrome/browser/views/frame/opaque_non_client_view.cc @@ -643,7 +643,7 @@ void OpaqueNonClientView::Paint(ChromeCanvas* canvas) { // TODO(beng): remove this gfx::Rect contents_bounds = frame_->GetContentsBounds(); - canvas->FillRectInt(SK_ColorWHITE, contents_bounds.x(), contents_bounds.y(), + canvas->FillRectInt(SK_ColorRED, contents_bounds.x(), contents_bounds.y(), contents_bounds.width(), contents_bounds.height()); } @@ -832,6 +832,8 @@ void OpaqueNonClientView::PaintClientEdge(ChromeCanvas* canvas) { // sides, such as the Bookmark bar, infobars, etc. gfx::Rect toolbar_bounds = frame_->GetToolbarBounds(); gfx::Rect client_area_bounds = frame_->GetContentsBounds(); + // For some reason things don't line up quite right, so we add and subtract + // pixels here and there for aesthetic bliss. client_area_bounds.SetRect( client_area_bounds.x(), frame_->client_view()->GetY() + toolbar_bounds.bottom() - 1, @@ -840,8 +842,8 @@ void OpaqueNonClientView::PaintClientEdge(ChromeCanvas* canvas) { toolbar_bounds.bottom() + 1 - kWindowVerticalBorderBottomSize)); canvas->TileImageInt(*right, client_area_bounds.right(), - client_area_bounds.y(), - right->width(), client_area_bounds.height()); + client_area_bounds.y() + 1, + right->width(), client_area_bounds.height() - 1); canvas->DrawBitmapInt(*bottom_right, client_area_bounds.right(), client_area_bounds.bottom()); canvas->TileImageInt(*bottom, client_area_bounds.x(), @@ -851,8 +853,8 @@ void OpaqueNonClientView::PaintClientEdge(ChromeCanvas* canvas) { client_area_bounds.x() - bottom_left->width(), client_area_bounds.bottom()); canvas->TileImageInt(*left, client_area_bounds.x() - left->width(), - client_area_bounds.y(), - left->width(), client_area_bounds.height()); + client_area_bounds.y() + 1, + left->width(), client_area_bounds.height() - 1); if (frame_->window_delegate()->ShouldShowWindowTitle()) { SkBitmap app_top_left = resources()->app_top_left(); @@ -860,12 +862,12 @@ void OpaqueNonClientView::PaintClientEdge(ChromeCanvas* canvas) { SkBitmap app_top_right = resources()->app_top_right(); canvas->DrawBitmapInt(app_top_left, client_area_bounds.x() - app_top_left.width(), - client_area_bounds.y() - app_top_left.height()); + client_area_bounds.y() - app_top_left.height() + 1); canvas->TileImageInt(app_top_center, client_area_bounds.x(), client_area_bounds.y() - app_top_center.height(), client_area_bounds.width(), app_top_center.height()); canvas->DrawBitmapInt(app_top_right, client_area_bounds.right(), - client_area_bounds.y() - app_top_right.height()); + client_area_bounds.y() - app_top_right.height() + 1); } } |