OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_VIEWS_FILL_ATTRIBUTE_H_ |
| 6 #define UI_VIEWS_FILL_ATTRIBUTE_H_ |
| 7 |
| 8 #include "ui/views/attributes.h" |
| 9 |
| 10 namespace views { |
| 11 |
| 12 enum class Fill { |
| 13 // Align view to the left of the parent's content bounds, expanding the |
| 14 // height to vertically fill the parent, minus the height any previously |
| 15 // Top or Bottom aligned views. |
| 16 Left, |
| 17 // Align view to the top of the parent's content bounds, exanding the width |
| 18 // horizontally to fill the parent. |
| 19 Top, |
| 20 // Align view to the right of the parent's content bounds, expanding the |
| 21 // height to vertically fill the parent, minus the height any previously |
| 22 // Top or Bottom aligned views. |
| 23 Right, |
| 24 // Align view to the bottom of the parent's content bounds, expanding the |
| 25 // width horizontally to fill the parent. |
| 26 Bottom, |
| 27 // Align view to the parent's content bounds, expanding the width and |
| 28 // height to fill the parent content/client area, minus any edge (Top, |
| 29 // Bottom, Left, Right) filled views. |
| 30 Content, |
| 31 }; |
| 32 |
| 33 class VIEWS_EXPORT FillAttribute : public CustomAttribute<Fill> { |
| 34 public: |
| 35 FillAttribute(Fill fill) : CustomAttribute<Fill>(fill) {} |
| 36 inline Fill fill() { return GetContent(); } |
| 37 AttributeId Identity() const override; |
| 38 void SetFill(Fill fill); |
| 39 }; |
| 40 |
| 41 REGISTER_ATTRIBUTE_ID(CustomAttribute<Fill>); |
| 42 REGISTER_ATTRIBUTE_ID(FillAttribute); |
| 43 |
| 44 } // namespace views |
| 45 |
| 46 #endif // UI_VIEWS_FILL_ATTRIBUTE_H_ |
| 47 |
OLD | NEW |