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

Unified Diff: ui/views/border.h

Issue 2475033003: Add ability to specify extra insets for a view via its border. (Closed)
Patch Set: better comment Created 4 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 | « ash/common/system/user/user_view.cc ('k') | ui/views/border.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/border.h
diff --git a/ui/views/border.h b/ui/views/border.h
index d30cc7ca0b00e2882b2b5288d9b058a98fa3858d..5a7b8c34d3bfa1872f107c32ab51969bb7a6e922 100644
--- a/ui/views/border.h
+++ b/ui/views/border.h
@@ -73,6 +73,19 @@ class VIEWS_EXPORT Border {
int right,
SkColor color);
+ // Adds extra, unpainted insets to |border|. This is effectively equivalent to
+ // adding an EmptyBorder and then |border|. Example:
sky 2016/11/04 15:32:53 optional: I would take this second sentence to mea
Evan Stade 2016/11/04 15:50:16 ok
+ //
+ // view->SetBorder(Border::AddInteriorPadding(
+ // Border::CreateSolidBorder(1, SK_ColorRED),
+ // gfx::Insets(2, 0, 0, 0)));
+ //
+ // yields a single dip red border and an additional 2dip of unpainted padding
+ // above the view content (below the border).
+ static std::unique_ptr<Border> AddInteriorPadding(
+ std::unique_ptr<Border> border,
+ const gfx::Insets& insets);
+
// Creates a Border from the specified Painter.
// |insets| define size of an area allocated for a Border.
static std::unique_ptr<Border> CreateBorderPainter(
« no previous file with comments | « ash/common/system/user/user_view.cc ('k') | ui/views/border.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698