Add SpaceEvenly to flex justification 52/259252/3
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Thu, 3 Jun 2021 06:05:10 +0000 (15:05 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Thu, 3 Jun 2021 09:11:56 +0000 (18:11 +0900)
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
dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp
dali-toolkit/public-api/controls/flex-container/flex-container.h
docs/content/programming-guide/flex-container.md

index d19c90b912b9503cb90f019b8dfcf232d054b6eb..a7349fef0041a7713bf55c432a621df38353138d 100644 (file)
@@ -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
 };
 
 /**
index 111e4802f7067c29cca8b77d89d5ab3a90644167..a3c092dcf48cefb281788096aa5d34981fe0db54 100644 (file)
@@ -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[] =
index 51e26f7c7fdcbea27724358f13168ad0ac41a13b..71589e0ca4e67eb6af990cab0715ec5e9a4b2972 100644 (file)
@@ -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
   };
 
   /**
index 4552527508a8609d09e0e6c8820f2f2692cd2f70..df6b9e4b95a3b83af34a6d81d1c7ecb59aa47a66 100644 (file)
@@ -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