diff options
author | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-13 21:10:05 +0000 |
---|---|---|
committer | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-13 21:10:05 +0000 |
commit | 4ebe94f246cc29c2c3b9c346258da40e2c0e479e (patch) | |
tree | 9fa07affb13a925a7541ee0d0caa7306fc8f5da6 /chrome | |
parent | 8387d43fea7fa7153f02c6305000fe1cc674a25d (diff) | |
download | chromium_src-4ebe94f246cc29c2c3b9c346258da40e2c0e479e.zip chromium_src-4ebe94f246cc29c2c3b9c346258da40e2c0e479e.tar.gz chromium_src-4ebe94f246cc29c2c3b9c346258da40e2c0e479e.tar.bz2 |
The width of the version field is not wide enough for all cases. We used to use set_default_width, but that gives you a size based on the average font size, so if you pass in 15 you might only fit ie. 11 chars, depending on what the text is.
I'd like to just say, take up all the width you have available - up to the icon in the dialog, that is, but the icon is part of a background image, so I just define a set width for the text field.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@826 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/views/about_chrome_view.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc index 90989b5..e7084cd 100644 --- a/chrome/browser/views/about_chrome_view.cc +++ b/chrome/browser/views/about_chrome_view.cc @@ -50,6 +50,12 @@ #include "generated_resources.h" +// The pixel width of the version text field. Ideally, we'd like to have the +// bounds set to the edge of the icon. However, the icon is not a view but a +// part of the background, so we have to hard code the width to make sure +// the version field doesn't overlap it. +const int kVersionFieldWidth = 195; + //////////////////////////////////////////////////////////////////////////////// // AboutChromeView, public: @@ -136,8 +142,6 @@ void AboutChromeView::Init() { version_label_->RemoveBorder(); version_label_->SetFont(ResourceBundle::GetSharedInstance().GetFont( ResourceBundle::BaseFont).DeriveFont(0, BOLD_FONTTYPE)); - version_label_->set_default_width_in_chars( - static_cast<int>(current_version_.size() + 1)); AddChildView(version_label_); // Text to display at the bottom of the dialog. @@ -198,7 +202,7 @@ void AboutChromeView::Layout() { about_title_label_->GetY() + about_title_label_->GetHeight() + kRelatedControlVerticalSpacing, - sz.cx, + kVersionFieldWidth, sz.cy); // For the width of the main text label we want to use up the whole panel |