Ver código fonte

LibCore: Support registration of TextWrapping properties

This is basically a named boolean.
sin-ack 4 anos atrás
pai
commit
1e44a0c2d9
1 arquivos alterados com 6 adições e 0 exclusões
  1. 6 0
      Userland/Libraries/LibCore/Object.h

+ 6 - 0
Userland/Libraries/LibCore/Object.h

@@ -377,4 +377,10 @@ T* Object::find_descendant_of_type_named(String const& name) requires IsBaseOf<O
         { Gfx::FontWeight::ExtraBold, "ExtraBold" },                 \
         { Gfx::FontWeight::Black, "Black" },                         \
         { Gfx::FontWeight::ExtraBlack, "ExtraBlack" })
+
+#define REGISTER_TEXT_WRAPPING_PROPERTY(property_name, getter, setter) \
+    REGISTER_ENUM_PROPERTY(                                            \
+        property_name, getter, setter, Gfx::TextWrapping,              \
+        { Gfx::TextWrapping::Wrap, "Wrap" },                           \
+        { Gfx::TextWrapping::DontWrap, "DontWrap" })
 }