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

Unified Diff: ui/views/controls/button/text_button.cc

Issue 82483003: Add GetMinimumSize() for Borders, and make LabelButton auto-size to at least as (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 1 month 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 | « ui/views/controls/button/text_button.h ('k') | ui/views/controls/focusable_border.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/text_button.cc
===================================================================
--- ui/views/controls/button/text_button.cc (revision 236640)
+++ ui/views/controls/button/text_button.cc (working copy)
@@ -78,6 +78,10 @@
return insets_;
}
+gfx::Size TextButtonBorder::GetMinimumSize() const {
+ return gfx::Size();
+}
+
void TextButtonBorder::SetInsets(const gfx::Insets& insets) {
insets_ = insets;
}
@@ -135,7 +139,18 @@
}
}
+gfx::Size TextButtonDefaultBorder::GetMinimumSize() const {
+ gfx::Size size;
+ if (normal_painter_)
+ size.SetToMax(normal_painter_->GetMinimumSize());
+ if (hot_painter_)
+ size.SetToMax(hot_painter_->GetMinimumSize());
+ if (pushed_painter_)
+ size.SetToMax(pushed_painter_->GetMinimumSize());
+ return size;
+}
+
// TextButtonNativeThemeBorder ------------------------------------------------
TextButtonNativeThemeBorder::TextButtonNativeThemeBorder(
« no previous file with comments | « ui/views/controls/button/text_button.h ('k') | ui/views/controls/focusable_border.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698