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 d19c90b..a7349fe 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 111e480..a3c092d 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 51e26f7..71589e0 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 4552527..df6b9e4 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