diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-08 20:08:12 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-08 20:08:12 +0000 |
commit | 3fa656cc226355392738ef8b3b146f30a700e507 (patch) | |
tree | 05206fe10d6f43ab2e0f3f172790f236edb4b91f /chrome/browser | |
parent | a7b4cfb74ed3a2fdec2607b4f97ab92f103eeea7 (diff) | |
download | chromium_src-3fa656cc226355392738ef8b3b146f30a700e507.zip chromium_src-3fa656cc226355392738ef8b3b146f30a700e507.tar.gz chromium_src-3fa656cc226355392738ef8b3b146f30a700e507.tar.bz2 |
Adjusting the page action icon drawing slightly.
When multiple page actions are active, there was no padding between icons. Also, the entry_width was being truncated too much (the more page actions the more apparent it came).
This fixes that.
BUG=12060
TEST=Have multiple page actions (more than 3) active in the Omnibox, make sure there is a little bit of space between each icon. Start typing and make sure you can type all the way to the page action icons.
Review URL: http://codereview.chromium.org/118390
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17888 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/views/location_bar_view.cc | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc index 353dd86..e514043 100644 --- a/chrome/browser/views/location_bar_view.cc +++ b/chrome/browser/views/location_bar_view.cc @@ -393,8 +393,7 @@ void LocationBarView::DoLayout(const bool force_layout) { for (size_t i = 0; i < page_action_image_views_.size(); i++) { if (page_action_image_views_[i]->IsVisible()) { page_action_size = page_action_image_views_[i]->GetPreferredSize(); - entry_width -= (page_action_size.width() + kInnerPadding) * - page_action_image_views_.size(); + entry_width -= page_action_size.width() + kInnerPadding; } } gfx::Size security_image_size; @@ -431,16 +430,23 @@ void LocationBarView::DoLayout(const bool force_layout) { // TODO(sky): baseline layout. int location_y = TopMargin(); int location_height = std::max(height() - location_y - kVertMargin, 0); + + // First set the bounds for the label that appears to the right of the + // security icon. + int offset = width() - kEntryPadding; if (info_label_.IsVisible()) { - info_label_.SetBounds(width() - kEntryPadding - info_label_size.width(), - location_y, + offset -= info_label_size.width(); + info_label_.SetBounds(offset, location_y, info_label_size.width(), location_height); + offset -= kInnerPadding; + } + if (security_image_view_.IsVisible()) { + offset -= security_image_size.width(); + security_image_view_.SetBounds(offset, location_y, + security_image_size.width(), + location_height); + offset -= kInnerPadding; } - const int info_label_width = info_label_size.width() ? - info_label_size.width() + kInnerPadding : 0; - - int offset = width() - kEntryPadding - info_label_width - - security_image_size.width(); for (size_t i = 0; i < page_action_image_views_.size(); i++) { if (page_action_image_views_[i]->IsVisible()) { @@ -449,13 +455,9 @@ void LocationBarView::DoLayout(const bool force_layout) { page_action_image_views_[i]->SetBounds(offset, location_y, page_action_size.width(), location_height); + offset -= kInnerPadding; } } - if (security_image_view_.IsVisible()) { - security_image_view_.SetBounds(width() - kEntryPadding - info_label_width - - security_image_size.width(), location_y, security_image_size.width(), - location_height); - } gfx::Rect location_bounds(kEntryPadding, location_y, entry_width, location_height); if (selected_keyword_view_.IsVisible()) { |