From 076e8c605ea2b17b591a9e8262c392280a8ffeb7 Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Thu, 3 Jun 2021 15:05:10 +0900 Subject: [PATCH] Add SpaceEvenly to flex justification Flex justification uses Yoga Layout's justify-content. Up to now, SpaceEvenly of Yoga Layout's justify-content has not been added to flex justification. SpaceAround distributes the equal space to before, and after each item. Therefore, the space between adjacent items is twice bigger than the space between the beginning edge and the first item. To distribute the equal space to before, between, and after each item, SpaceEvenly is added to flex justification. Change-Id: Icb4e1f1aa74f52a5cfe8f1399e9f42457c8c081f --- dali-toolkit/devel-api/layouting/flex-node.h | 3 ++- dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp | 3 ++- dali-toolkit/public-api/controls/flex-container/flex-container.h | 3 ++- docs/content/programming-guide/flex-container.md | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dali-toolkit/devel-api/layouting/flex-node.h b/dali-toolkit/devel-api/layouting/flex-node.h index d19c90b..a7349fe 100644 --- a/dali-toolkit/devel-api/layouting/flex-node.h +++ b/dali-toolkit/devel-api/layouting/flex-node.h @@ -55,7 +55,8 @@ enum class Justification CENTER, ///< Items are positioned at the center of the container FLEX_END, ///< Items are positioned at the end of the container SPACE_BETWEEN, ///< Items are positioned with equal space between the items - SPACE_AROUND ///< Items are positioned with equal space before, between, and after the items + SPACE_AROUND, ///< Items are positioned with equal space before, and after the items + SPACE_EVENLY ///< Items are positioned with equal space before, between, and after the items }; /** diff --git a/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp b/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp index 111e480..a3c092d 100644 --- a/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp +++ b/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp @@ -127,7 +127,8 @@ const Scripting::StringEnum JUSTIFY_CONTENT_STRING_TABLE[] = {"center", Toolkit::FlexContainer::JUSTIFY_CENTER}, {"flexEnd", Toolkit::FlexContainer::JUSTIFY_FLEX_END}, {"spaceBetween", Toolkit::FlexContainer::JUSTIFY_SPACE_BETWEEN}, - {"spaceAround", Toolkit::FlexContainer::JUSTIFY_SPACE_AROUND}}; + {"spaceAround", Toolkit::FlexContainer::JUSTIFY_SPACE_AROUND}, + {"spaceEvenly", Toolkit::FlexContainer::JUSTIFY_SPACE_EVENLY}}; const unsigned int JUSTIFY_CONTENT_STRING_TABLE_COUNT = sizeof(JUSTIFY_CONTENT_STRING_TABLE) / sizeof(JUSTIFY_CONTENT_STRING_TABLE[0]); const Scripting::StringEnum ALIGN_ITEMS_STRING_TABLE[] = diff --git a/dali-toolkit/public-api/controls/flex-container/flex-container.h b/dali-toolkit/public-api/controls/flex-container/flex-container.h index 51e26f7..71589e0 100644 --- a/dali-toolkit/public-api/controls/flex-container/flex-container.h +++ b/dali-toolkit/public-api/controls/flex-container/flex-container.h @@ -138,7 +138,8 @@ public: JUSTIFY_CENTER, ///< Items are positioned at the center of the container @SINCE_1_1.35 JUSTIFY_FLEX_END, ///< Items are positioned at the end of the container @SINCE_1_1.35 JUSTIFY_SPACE_BETWEEN, ///< Items are positioned with equal space between the lines @SINCE_1_1.35 - JUSTIFY_SPACE_AROUND ///< Items are positioned with equal space before, between, and after the lines @SINCE_1_1.35 + JUSTIFY_SPACE_AROUND, ///< Items are positioned with equal space before, and after the lines @SINCE_1_1.35 + JUSTIFY_SPACE_EVENLY ///< Items are positioned with equal space before, between, and after the lines @SINCE_2_0.29 }; /** diff --git a/docs/content/programming-guide/flex-container.md b/docs/content/programming-guide/flex-container.md index 4552527..df6b9e4 100644 --- a/docs/content/programming-guide/flex-container.md +++ b/docs/content/programming-guide/flex-container.md @@ -115,7 +115,8 @@ The possible values for this property are: | JUSTIFY_CENTER | Items are positioned at the center of the container | | JUSTIFY_FLEX_END | Items are positioned at the end of the container | | JUSTIFY_SPACE_BETWEEN | Items are positioned with equal space between the lines | -| JUSTIFY_SPACE_AROUND | Items are positioned with equal space before, between, and after the lines | +| JUSTIFY_SPACE_AROUND | Items are positioned with equal space before, and after the lines | +| JUSTIFY_SPACE_EVENLY | Items are positioned with equal space before, between, and after the lines | ### Usage -- 2.7.4