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

Unified Diff: ui/views/controls/button/image_button.h

Issue 583843003: views::ImageButton: Added SetMinimumImageSize; removed SetPreferredSize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delete usage of SetPreferredSize entirely -- these had no effect. Created 6 years, 3 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: ui/views/controls/button/image_button.h
diff --git a/ui/views/controls/button/image_button.h b/ui/views/controls/button/image_button.h
index fc02b8ac9cec181e305dd9630efd9f5065f1d13e..fbdf42927816e2d45a515d2eb3e9d3203bcc301b 100644
--- a/ui/views/controls/button/image_button.h
+++ b/ui/views/controls/button/image_button.h
@@ -57,11 +57,11 @@ class VIEWS_EXPORT ImageButton : public CustomButton {
void SetFocusPainter(scoped_ptr<Painter> focus_painter);
- // Sets preferred size, so it could be correctly positioned in layout even if
- // it is NULL.
- void SetPreferredSize(const gfx::Size& preferred_size) {
- preferred_size_ = preferred_size;
- }
+ // The minimum size of the contents (not including the border). The contents
+ // will be at least this size, but may be larger if the image itself is
+ // larger.
+ const gfx::Size& minimum_image_size() const { return minimum_image_size_; }
+ void SetMinimumImageSize(const gfx::Size& size);
// Whether we should draw our images resources horizontally flipped.
void SetDrawImageMirrored(bool mirrored) {
@@ -104,7 +104,7 @@ class VIEWS_EXPORT ImageButton : public CustomButton {
// Image alignment.
HorizontalAlignment h_alignment_;
VerticalAlignment v_alignment_;
- gfx::Size preferred_size_;
+ gfx::Size minimum_image_size_;
// Whether we draw our resources horizontally flipped. This can happen in the
// linux titlebar, where image resources were designed to be flipped so a

Powered by Google App Engine
This is Rietveld 408576698