From 3580f8ab437a82b6afa6fb15b76d8f719547f8f2 Mon Sep 17 00:00:00 2001 From: uramer Date: Tue, 5 Apr 2022 17:52:23 +0200 Subject: [PATCH] Add Flex widget documentation --- .../lua-scripting/user_interface.rst | 1 + .../reference/lua-scripting/widgets/flex.rst | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 docs/source/reference/lua-scripting/widgets/flex.rst diff --git a/docs/source/reference/lua-scripting/user_interface.rst b/docs/source/reference/lua-scripting/user_interface.rst index 71ad61b410..394c53e688 100644 --- a/docs/source/reference/lua-scripting/user_interface.rst +++ b/docs/source/reference/lua-scripting/user_interface.rst @@ -81,6 +81,7 @@ Widget types Text: Displays text. TextEdit: Accepts text input from the user. Image: Renders a texture. + Flex: Aligns children in a column/row Example ------- diff --git a/docs/source/reference/lua-scripting/widgets/flex.rst b/docs/source/reference/lua-scripting/widgets/flex.rst new file mode 100644 index 0000000000..359d0d4394 --- /dev/null +++ b/docs/source/reference/lua-scripting/widgets/flex.rst @@ -0,0 +1,43 @@ +Flex Widget +=========== + +Aligns its children along either a column or a row, depending on the `horizontal` property. + +Properties +---------- + +.. list-table:: + :header-rows: 1 + :widths: 20 20 60 + + * - name + - type (default value) + - description + * - horizontal + - bool (false) + - Flex aligns its children in a row if true, otherwise in a column. + * - autoSize + - bool (true) + - | If true, Flex will automatically resize to fit its contents. + | Children can't be relatively position/sized when true. + * - align + - ui.ALIGNMENT (Start) + - Where to align the children in the main axis. + * - arrange + - ui.ALIGNMETN (Start) + - How to arrange the children in the cross axis. + +External +-------- +.. list-table:: + :header-rows: 1 + :widths: 20 20 60 + + * - name + - type (default value) + - description + * - grow + - float (0) + - | Grow factor for the child. If there is unused space in the Flex, + | it will be split between widgets according to this value. + | Has no effect if `autoSize` is `true`.