You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2020/08/30 14:47:39 UTC

[royale-asjs] branch develop updated: jewel-tabbar: paddings L & R as well removed from CSS

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 834b3e2  jewel-tabbar: paddings L & R as well removed from CSS
834b3e2 is described below

commit 834b3e2a3e1e4ba702df34080503e61855fdcb7c
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sun Aug 30 16:47:29 2020 +0200

    jewel-tabbar: paddings L & R as well removed from CSS
---
 .../itemRenderers/TabBarHorizontalIconItemRenderer.mxml   |  2 +-
 .../itemRenderers/TabBarVerticalIconItemRenderer.mxml     |  2 +-
 frameworks/projects/Jewel/src/main/resources/defaults.css |  1 -
 .../beads/itemRenderers/TabBarItemRendererInitializer.as  | 15 +++++++++++----
 .../projects/Jewel/src/main/sass/components/_tabbar.sass  |  5 -----
 .../src/main/sass/components-primary/_tabbar.sass         |  5 -----
 6 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarHorizontalIconItemRenderer.mxml b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarHorizontalIconItemRenderer.mxml
index c6b04c4..f723f76 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarHorizontalIconItemRenderer.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarHorizontalIconItemRenderer.mxml
@@ -37,7 +37,7 @@ limitations under the License.
 
     <j:beads>
         <js:ItemRendererDataBinding/>
-        <j:Paddings paddingTop="12" paddingBottom="12"/>
+        <j:Paddings paddingLeft="24" paddingRight="24" paddingTop="12" paddingBottom="12"/>
     </j:beads>
 
     <j:HGroup gap="4" itemsVerticalAlign="itemsCenter">
diff --git a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarVerticalIconItemRenderer.mxml b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarVerticalIconItemRenderer.mxml
index dfc7b62..667b8d7 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarVerticalIconItemRenderer.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/itemRenderers/TabBarVerticalIconItemRenderer.mxml
@@ -37,7 +37,7 @@ limitations under the License.
 
     <j:beads>
         <js:ItemRendererDataBinding/>
-        <j:Paddings paddingTop="12" paddingBottom="12"/>
+        <j:Paddings paddingLeft="24" paddingRight="24" paddingTop="12" paddingBottom="12"/>
     </j:beads>
 
     <j:VGroup itemsHorizontalAlign="itemsCenter">
diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 5dfd870..a7b016f 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -3674,7 +3674,6 @@ j|TabBar {
 
 .jewel.tabbarbutton {
   margin: 0;
-  padding: 0 24px;
   position: relative;
   display: flex;
   flex: 1 0 auto !important;
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/itemRenderers/TabBarItemRendererInitializer.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/itemRenderers/TabBarItemRendererInitializer.as
index 6aae51b..42ed050 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/itemRenderers/TabBarItemRendererInitializer.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/itemRenderers/TabBarItemRendererInitializer.as
@@ -67,15 +67,22 @@ package org.apache.royale.jewel.beads.itemRenderers
 
 			trace(_strand, tir.height, paddings, presentationModel.rowHeight, ListPresentationModel.DEFAULT_ROW_HEIGHT )
 			
-			if(!paddings && !(tir.height > ListPresentationModel.DEFAULT_ROW_HEIGHT))
+			if(!paddings)
 			{
 				paddings = new Paddings();
-				paddings.paddingTop = DEFAULT_PADDING;
-				paddings.paddingBottom = DEFAULT_PADDING;
+				// always set at least L & R paddings
+				paddings.paddingLeft = DEFAULT_PADDING_LR;
+				paddings.paddingRight = DEFAULT_PADDING_LR;
+				if(!(tir.height > ListPresentationModel.DEFAULT_ROW_HEIGHT)) 
+				{
+					paddings.paddingTop = DEFAULT_PADDING_TB;
+					paddings.paddingBottom = DEFAULT_PADDING_TB;
+				}
 				ir.addBead(paddings)
 			}
 		}
 
-		public static const DEFAULT_PADDING:Number = 12;
+		public static const DEFAULT_PADDING_LR:Number = 24;
+		public static const DEFAULT_PADDING_TB:Number = 12;
 	}
 }
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_tabbar.sass b/frameworks/projects/Jewel/src/main/sass/components/_tabbar.sass
index 98f432e..f28b26d 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_tabbar.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_tabbar.sass
@@ -62,16 +62,11 @@ j|TabBar
 
 // Jewel TabBarButtonItemRenderer
 $tabbarbutton-margin: 0 !default
-$tabbarbutton-padding: 0 24px !default
-// $tabbarbutton-margin-height: 48px
 
 // TabBarButtonItemRenderer variables
 .jewel
     &.tabbarbutton
-        // height: $tabbarbutton-margin-height
-        // min-height: $tabbarbutton-margin-height
         margin: $tabbarbutton-margin //to avoid margin in safari
-        padding: $tabbarbutton-padding
         
         position: relative
         display: flex
diff --git a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_tabbar.sass b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_tabbar.sass
index 2890994..fb2947a 100644
--- a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_tabbar.sass
+++ b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_tabbar.sass
@@ -21,20 +21,15 @@
 
 // TabBar variables
 
-
 .jewel
     &.tabbar
         &.sameWidths
-            // .content
             > *
                 flex: 1 0 0% !important
 
 // Jewel TabBarButtonItemRenderer
 
 // TabBarButtonItemRenderer variables
-// Jewel NavigationLinkItemRenderer
-
-// NavigationLinkItemRenderer variables
 .jewel
     &.tabbarbutton
         font: