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

Unified Diff: chrome/browser/chromeos/status/status_area_button.cc

Issue 6532050: Fix resizing behavior of the input method button in the chromeos status bar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removing logging header Created 9 years, 10 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/chromeos/status/status_area_button.cc
diff --git a/chrome/browser/chromeos/status/status_area_button.cc b/chrome/browser/chromeos/status/status_area_button.cc
index a864efae1278e4ca561985d2edf1ebca7e3e2f75..d0520a379418ce02113e17892e9b341f3d3c7167 100644
--- a/chrome/browser/chromeos/status/status_area_button.cc
+++ b/chrome/browser/chromeos/status/status_area_button.cc
@@ -79,8 +79,11 @@ void StatusAreaButton::SetText(const std::wstring& text) {
// TextButtons normally remember the max text size, so the button's preferred
// size will always be as large as the largest text ever put in it.
// We clear that max text size, so we can adjust the size to fit the text.
- ClearMaxTextSize();
+ // The order is important. ClearMaxTextSize sets the size to that of the
+ // current text, so it must be called after SetText.
views::MenuButton::SetText(text);
+ ClearMaxTextSize();
+ PreferredSizeChanged();
}
void StatusAreaButton::DrawIcon(gfx::Canvas* canvas) {
« 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