Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5151)

Unified Diff: chrome/browser/ui/views/about_chrome_view.cc

Issue 7280019: Fixes bug where clicks on 'ok' button in about dialog wouldn't (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unneeded field Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/about_chrome_view.cc
diff --git a/chrome/browser/ui/views/about_chrome_view.cc b/chrome/browser/ui/views/about_chrome_view.cc
index 0e005a60d0b9428be01e3553fc041f6833e3fb97..ed05d5df2f0a2ec059f8e162343e52807abe8578 100644
--- a/chrome/browser/ui/views/about_chrome_view.cc
+++ b/chrome/browser/ui/views/about_chrome_view.cc
@@ -33,6 +33,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
+#include "views/controls/button/text_button.h"
#include "views/controls/link.h"
#include "views/controls/textfield/textfield.h"
#include "views/controls/throbber.h"
@@ -401,16 +402,26 @@ void AboutChromeView::Layout() {
timeout_indicator_.SetBounds(throbber_topleft_x, throbber_topleft_y,
sz.width(), sz.height());
- // The update label should be at the bottom of the screen, to the right of
- // the throbber. We specify width to the end of the dialog because it contains
- // variable length messages.
+ // The update label should be at the bottom of the screen, to the right of the
+ // throbber. It vertically lines up with the ok button, so we make sure it
+ // doesn't extend into the ok button.
sz = update_label_.GetPreferredSize();
int update_label_x = throbber_->x() + throbber_->width() +
views::kRelatedControlHorizontalSpacing;
+ views::DialogClientView* dialog_client_view = GetDialogClientView();
+ int max_x = parent_bounds.width();
+ if (dialog_client_view->ok_button() &&
+ dialog_client_view->ok_button()->IsVisible()) {
+ max_x = std::min(dialog_client_view->ok_button()->x(), max_x);
+ }
+ if (dialog_client_view->cancel_button() &&
+ dialog_client_view->cancel_button()->IsVisible()) {
+ max_x = std::min(dialog_client_view->cancel_button()->x(), max_x);
+ }
update_label_.SetHorizontalAlignment(views::Label::ALIGN_LEFT);
update_label_.SetBounds(update_label_x,
throbber_topleft_y + 1,
- parent_bounds.width() - update_label_x,
+ std::min(max_x - update_label_x, sz.width()),
sz.height());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698