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

Unified Diff: chrome/views/radio_button.cc

Issue 7344: Convert GetPreferredSize from:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 2 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
Index: chrome/views/radio_button.cc
===================================================================
--- chrome/views/radio_button.cc (revision 3391)
+++ chrome/views/radio_button.cc (working copy)
@@ -60,11 +60,13 @@
return kViewClassName;
}
-void RadioButton::GetPreferredSize(CSize *out) {
- label_->GetPreferredSize(out);
- out->cy = std::max(static_cast<int>(out->cy + kFocusPaddingVertical * 2),
- kRadioHeight) ;
- out->cx += kRadioToLabel + kRadioWidth + kFocusPaddingHorizontal * 2;
+gfx::Size RadioButton::GetPreferredSize() {
+ gfx::Size prefsize = label_->GetPreferredSize();
+ prefsize.set_height(std::max(prefsize.height() + kFocusPaddingVertical * 2,
+ kRadioHeight));
+ prefsize.Enlarge(kRadioToLabel + kRadioWidth + kFocusPaddingHorizontal * 2,
+ 0);
+ return prefsize;
}
void RadioButton::Layout() {

Powered by Google App Engine
This is Rietveld 408576698