| 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_
|
| +
|
|
|