diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 22:53:14 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 22:53:14 +0000 |
commit | a572098730e9e2c355b4f99a8d7087a5b1e64b1b (patch) | |
tree | c4037b7a87256995e13c0d6678f850ae1765d8fa /chrome/browser/views | |
parent | 3a740b30a7ada4266cae5a1a5658e850dd663e22 (diff) | |
download | chromium_src-a572098730e9e2c355b4f99a8d7087a5b1e64b1b.zip chromium_src-a572098730e9e2c355b4f99a8d7087a5b1e64b1b.tar.gz chromium_src-a572098730e9e2c355b4f99a8d7087a5b1e64b1b.tar.bz2 |
Several minor visual fixes to toolstrips:
* Layout toolstrips on the left of the bookmark bar so that
something always obviously happens when you install one.
This is in response to some feedback I've gotten demoing
toolstrips for various people.
* Open the NTP on install if the bookmarkbar isn't visible.
Again, I'm trying to make something happen when you
install an extension. This won't be the permanent behavior
but it seems like doing nothing if you have your bookmark
bar detached is likely to confuse people.
* Fix a bug where we kept trying to resize the toolstrip
back to the width it had when it was first made visible.
* Fix a bug where we didn't always repaint the bookmarkbar
after the toolstrip preferred width changed.
This also seems to fix the issue where the buildbot sample
shows up overlayed on top of tab contents, though I didn't
mean to fix that with this CL.
Review URL: http://codereview.chromium.org/100310
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15249 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/bookmark_bar_view.cc | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index d9ebbd6..88f0fb5 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -535,8 +535,6 @@ void BookmarkBarView::Layout() { if (!GetParent()) return; - // First layout out the buttons. Any buttons that are placed beyond the - // visible region and made invisible. int x = kLeftMargin; int y = kTopMargin; int width = View::width() - kRightMargin - kLeftMargin; @@ -566,6 +564,22 @@ void BookmarkBarView::Layout() { overflow_pref.width() - kButtonPadding - bookmarks_separator_pref.width(); + // First, layout extension toolstrips. + // We put these always on the left as a temporary hack until we have the + // extension bar. Otherwise, people install extensions and they don't see + // anything happen and are confused. + for (int i = GetBookmarkButtonCount(); + i < GetBookmarkButtonCount() + num_extension_toolstrips_; ++i) { + views::View* child = GetChildViewAt(i); + gfx::Size pref = child->GetPreferredSize(); + int next_x = x + pref.width() + kButtonPadding; + child->SetVisible(next_x < max_x); + child->SetBounds(x, y, pref.width(), height); + x = next_x; + } + + // Next, layout out the buttons. Any buttons that are placed beyond the + // visible region and made invisible. if (GetBookmarkButtonCount() == 0 && model_ && model_->IsLoaded()) { gfx::Size pref = instructions_->GetPreferredSize(); instructions_->SetBounds( @@ -587,17 +601,6 @@ void BookmarkBarView::Layout() { } } - // Extension toolstrips. - for (int i = GetBookmarkButtonCount(); - i < GetBookmarkButtonCount() + num_extension_toolstrips_; ++i) { - views::View* child = GetChildViewAt(i); - gfx::Size pref = child->GetPreferredSize(); - int next_x = x + pref.width() + kButtonPadding; - child->SetVisible(next_x < max_x); - child->SetBounds(x, y, pref.width(), height); - x = next_x; - } - // Layout the right side of the bar. const bool all_visible = (GetBookmarkButtonCount() == 0 || |