Commit dd9dfe99 authored by Wei Li's avatar Wei Li Committed by Commit Bot

Add builder macro to Separator class

Add builder macro to allow using Separator builder class.

Bug: 1130078
Change-Id: I50ce0b279a75e86bb328228f2f9ccb606ddc0a1b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2427583Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Wei Li <weili@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810400}
parent 237fd050
...@@ -19,9 +19,7 @@ Separator::Separator() = default; ...@@ -19,9 +19,7 @@ Separator::Separator() = default;
Separator::~Separator() = default; Separator::~Separator() = default;
SkColor Separator::GetColor() const { SkColor Separator::GetColor() const {
if (overridden_color_ == true) return overridden_color_.value_or(0);
return overridden_color_.value();
return 0;
} }
void Separator::SetColor(SkColor color) { void Separator::SetColor(SkColor color) {
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/optional.h" #include "base/optional.h"
#include "ui/views/metadata/view_factory.h"
#include "ui/views/view.h" #include "ui/views/view.h"
namespace views { namespace views {
...@@ -42,6 +43,11 @@ class VIEWS_EXPORT Separator : public View { ...@@ -42,6 +43,11 @@ class VIEWS_EXPORT Separator : public View {
DISALLOW_COPY_AND_ASSIGN(Separator); DISALLOW_COPY_AND_ASSIGN(Separator);
}; };
BEGIN_VIEW_BUILDER(VIEWS_EXPORT, Separator, View)
VIEW_BUILDER_PROPERTY(SkColor, Color)
VIEW_BUILDER_PROPERTY(int, PreferredHeight)
END_VIEW_BUILDER(VIEWS_EXPORT, Separator)
} // namespace views } // namespace views
#endif // UI_VIEWS_CONTROLS_SEPARATOR_H_ #endif // UI_VIEWS_CONTROLS_SEPARATOR_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment