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

Side by Side Diff: ui/views/fill_attribute.h

Issue 2230913003: Experimental alignment layout manager using a property on the views Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed AlignAttribute and associated types to FillAttribute Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « ui/views/examples/fill_example.cc ('k') | ui/views/fill_attribute.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « ui/views/examples/fill_example.cc ('k') | ui/views/fill_attribute.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698