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

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

Issue 2744463002: Add VectorIconButton functionality to ImageButton. (Closed)
Patch Set: WIP: use observer Created 3 years, 9 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.cc
diff --git a/ui/views/controls/button/image_button.cc b/ui/views/controls/button/image_button.cc
index fd2151e2a1aab73c6ad529ec5a909ffd9ea309ab..2eb38bda8cc715668720fa46dfc0f2c68c5d2224 100644
--- a/ui/views/controls/button/image_button.cc
+++ b/ui/views/controls/button/image_button.cc
@@ -12,6 +12,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/scoped_canvas.h"
+#include "ui/views/border.h"
#include "ui/views/painter.h"
#include "ui/views/widget/widget.h"
@@ -95,6 +96,13 @@ void ImageButton::SetMinimumImageSize(const gfx::Size& size) {
PreferredSizeChanged();
}
+void ImageButton::SetPadding(const gfx::Insets& padding) {
Evan Stade 2017/03/15 15:04:02 What is the motivation to add this method instead
Bret 2017/03/15 23:39:19 I see a lot of places where we're doing SetBorder(
+ if (padding.IsEmpty())
+ SetBorder(NullBorder());
+ else
+ SetBorder(CreateEmptyBorder(padding));
+}
+
////////////////////////////////////////////////////////////////////////////////
// ImageButton, View overrides:

Powered by Google App Engine
This is Rietveld 408576698