From 4ebe94f246cc29c2c3b9c346258da40e2c0e479e Mon Sep 17 00:00:00 2001 From: "finnur@google.com" Date: Wed, 13 Aug 2008 21:10:05 +0000 Subject: 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 --- chrome/browser/views/about_chrome_view.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'chrome/browser/views/about_chrome_view.cc') 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(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 -- cgit v1.1