From 1e70986d1996a5398d15e0769f39bc08d352dff5 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 28 Dec 2020 20:45:04 +0100 Subject: [PATCH] LibCore: Add REGISTER_TEXT_ALIGNMENT_PROPERTY macro --- Libraries/LibCore/Object.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Libraries/LibCore/Object.h b/Libraries/LibCore/Object.h index ff513e8c57e..7247ab97bd7 100644 --- a/Libraries/LibCore/Object.h +++ b/Libraries/LibCore/Object.h @@ -305,4 +305,14 @@ const LogStream& operator<<(const LogStream&, const Object&); property_name, getter, setter, GUI::SizePolicy, \ { GUI::SizePolicy::Fill, "Fill" }, \ { GUI::SizePolicy::Fixed, "Fixed" }) + +#define REGISTER_TEXT_ALIGNMENT_PROPERTY(property_name, getter, setter) \ + REGISTER_ENUM_PROPERTY( \ + property_name, getter, setter, Gfx::TextAlignment, \ + { Gfx::TextAlignment::TopLeft, "TopLeft" }, \ + { Gfx::TextAlignment::CenterLeft, "CenterLeft" }, \ + { Gfx::TextAlignment::Center, "Center" }, \ + { Gfx::TextAlignment::CenterRight, "CenterRight" }, \ + { Gfx::TextAlignment::TopRight, "TopRight" }, \ + { Gfx::TextAlignment::BottomRight, "BottomRight" }) }