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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/fill_attribute.h
diff --git a/ui/views/fill_attribute.h b/ui/views/fill_attribute.h
new file mode 100644
index 0000000000000000000000000000000000000000..53a12fc7bcac58f4c13e839e19a2812f4eb5dcca
--- /dev/null
+++ b/ui/views/fill_attribute.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_VIEWS_FILL_ATTRIBUTE_H_
+#define UI_VIEWS_FILL_ATTRIBUTE_H_
+
+#include "ui/views/attributes.h"
+
+namespace views {
+
+enum class Fill {
+ // Align view to the left of the parent's content bounds, expanding the
+ // height to vertically fill the parent, minus the height any previously
+ // Top or Bottom aligned views.
+ Left,
+ // Align view to the top of the parent's content bounds, exanding the width
+ // horizontally to fill the parent.
+ Top,
+ // Align view to the right of the parent's content bounds, expanding the
+ // height to vertically fill the parent, minus the height any previously
+ // Top or Bottom aligned views.
+ Right,
+ // Align view to the bottom of the parent's content bounds, expanding the
+ // width horizontally to fill the parent.
+ Bottom,
+ // Align view to the parent's content bounds, expanding the width and
+ // height to fill the parent content/client area, minus any edge (Top,
+ // Bottom, Left, Right) filled views.
+ Content,
+};
+
+class VIEWS_EXPORT FillAttribute : public CustomAttribute<Fill> {
+ public:
+ FillAttribute(Fill fill) : CustomAttribute<Fill>(fill) {}
+ inline Fill fill() { return GetContent(); }
+ AttributeId Identity() const override;
+ void SetFill(Fill fill);
+};
+
+REGISTER_ATTRIBUTE_ID(CustomAttribute<Fill>);
+REGISTER_ATTRIBUTE_ID(FillAttribute);
+
+} // namespace views
+
+#endif // UI_VIEWS_FILL_ATTRIBUTE_H_
+
« 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