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

Side by Side Diff: ui/gfx/geometry/insets.h

Issue 2440723003: Tweaks to ToggleButton details. (Closed)
Patch Set: no new layer 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/gfx/geometry/insets.cc » ('j') | ui/views/controls/button/toggle_button.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GFX_GEOMETRY_INSETS_H_ 5 #ifndef UI_GFX_GEOMETRY_INSETS_H_
6 #define UI_GFX_GEOMETRY_INSETS_H_ 6 #define UI_GFX_GEOMETRY_INSETS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "ui/gfx/geometry/insets_f.h" 10 #include "ui/gfx/geometry/insets_f.h"
11 #include "ui/gfx/gfx_export.h" 11 #include "ui/gfx/gfx_export.h"
12 12
13 namespace gfx { 13 namespace gfx {
14 14
15 class Vector2d;
16
15 // Represents the widths of the four borders or margins of an unspecified 17 // Represents the widths of the four borders or margins of an unspecified
16 // rectangle. An Insets stores the thickness of the top, left, bottom and right 18 // rectangle. An Insets stores the thickness of the top, left, bottom and right
17 // edges, without storing the actual size and position of the rectangle itself. 19 // edges, without storing the actual size and position of the rectangle itself.
18 // 20 //
19 // This can be used to represent a space within a rectangle, by "shrinking" the 21 // This can be used to represent a space within a rectangle, by "shrinking" the
20 // rectangle by the inset amount on all four sides. Alternatively, it can 22 // rectangle by the inset amount on all four sides. Alternatively, it can
21 // represent a border that has a different thickness on each side. 23 // represent a border that has a different thickness on each side.
22 class GFX_EXPORT Insets { 24 class GFX_EXPORT Insets {
23 public: 25 public:
24 constexpr Insets() : top_(0), left_(0), bottom_(0), right_(0) {} 26 constexpr Insets() : top_(0), left_(0), bottom_(0), right_(0) {}
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 inline Insets operator+(Insets lhs, const Insets& rhs) { 113 inline Insets operator+(Insets lhs, const Insets& rhs) {
112 lhs += rhs; 114 lhs += rhs;
113 return lhs; 115 return lhs;
114 } 116 }
115 117
116 inline Insets operator-(Insets lhs, const Insets& rhs) { 118 inline Insets operator-(Insets lhs, const Insets& rhs) {
117 lhs -= rhs; 119 lhs -= rhs;
118 return lhs; 120 return lhs;
119 } 121 }
120 122
123 GFX_EXPORT Insets operator+(const Insets& insets, const gfx::Vector2d& vector);
Evan Stade 2016/10/27 17:12:14 I've wanted this before --- I think it will get us
varkha 2016/10/27 19:02:00 Does it make sense to add a short doc here to avoi
Evan Stade 2016/10/27 19:08:47 I don't think so. We don't do it for any other ope
124
121 } // namespace gfx 125 } // namespace gfx
122 126
123 #endif // UI_GFX_GEOMETRY_INSETS_H_ 127 #endif // UI_GFX_GEOMETRY_INSETS_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/geometry/insets.cc » ('j') | ui/views/controls/button/toggle_button.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698