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

yishayw 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 7a6c988  Fixes gap issue in spark tab bar.
     new 58ded71  Merge branch 'develop' of 
https://github.com/apache/royale-asjs into develop
7a6c988 is described below

commit 7a6c988b562b1b7708f22f0574a9f27424bb68f5
Author: DESKTOP-RH4S838\Yishay <yishayj...@hotmail.com>
AuthorDate: Tue Oct 29 17:19:44 2019 +0200

    Fixes gap issue in spark tab bar.
    
    Reference #475
---
 .../SparkRoyale/src/main/resources/defaults.css    |  2 +-
 .../src/main/resources/spark-royale-manifest.xml   |  1 +
 .../royale/spark/components/beads/TabBarView.as    | 65 ++++++++++++++++++++++
 .../src/main/royale/spark/core/IGapLayout.as       | 36 ++++++++++++
 .../main/royale/spark/layouts/HorizontalLayout.as  |  3 +-
 .../main/royale/spark/layouts/VerticalLayout.as    |  3 +-
 6 files changed, 107 insertions(+), 3 deletions(-)

diff --git a/frameworks/projects/SparkRoyale/src/main/resources/defaults.css 
b/frameworks/projects/SparkRoyale/src/main/resources/defaults.css
index 471e1b3..f7eeeda 100644
--- a/frameworks/projects/SparkRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/SparkRoyale/src/main/resources/defaults.css
@@ -166,7 +166,7 @@ SkinnableContainer
 
 TabBar
 {
-       IBeadView: 
ClassReference("spark.components.beads.SkinnableContainerView");
+       IBeadView: ClassReference("spark.components.beads.TabBarView");
        IBeadLayout: 
ClassReference("spark.layouts.supportClasses.SparkLayoutBead");
        IViewport: 
ClassReference("org.apache.royale.html.supportClasses.ScrollingViewport");
        IViewportModel: 
ClassReference("org.apache.royale.html.beads.models.ViewportModel");
diff --git 
a/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml 
b/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml
index 74e7605..265edde 100644
--- 
a/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml
+++ 
b/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml
@@ -112,6 +112,7 @@
     
     <component id="NonVirtualHDataGroup" 
class="spark.components.NonVirtualHDataGroup"/>
     <component id="NonVirtualVDataGroup" 
class="spark.components.NonVirtualVDataGroup"/>
+    <component id="TabBarView" class="spark.components.beads.TabBarView"/>
     <component id="MXAdvancedDataGridItemRenderer" 
class="spark.controls.advancedDataGridClasses.MXAdvancedDataGridItemRenderer"/>
     <component id="SparkTextButtonItemRenderer" 
class="spark.components.supportClasses.SparkTextButtonItemRenderer"/>
 
diff --git 
a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/beads/TabBarView.as
 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/beads/TabBarView.as
new file mode 100644
index 0000000..39a5dbd
--- /dev/null
+++ 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/beads/TabBarView.as
@@ -0,0 +1,65 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.components.beads
+{
+
+import spark.components.SkinnableContainer;
+import org.apache.royale.events.Event;
+import org.apache.royale.core.IStrand;
+import spark.core.IGapLayout;
+
+/**
+ *  @private
+ *  The SkinnableContainerView for emulation.
+ */
+public class TabBarView extends SkinnableContainerView
+{
+       
//--------------------------------------------------------------------------
+       //
+       //  Constructor
+       //
+       
//--------------------------------------------------------------------------
+
+       /**
+        *  Constructor.
+        *  
+        *  @langversion 3.0
+        *  @playerversion Flash 9
+        *  @playerversion AIR 1.1
+        *  @productversion Flex 3
+        */
+       public function TabBarView()
+       {
+               super();
+       }
+
+       override protected function handleInitComplete(event:Event):void
+       {
+               super.handleInitComplete();
+               var gapLayout:IGapLayout = (contentView as 
IStrand).getBeadByType(IGapLayout) as IGapLayout;
+               if (gapLayout)
+               {
+                       gapLayout.gap = 0;
+               }
+       }
+    
+}
+
+}
diff --git 
a/frameworks/projects/SparkRoyale/src/main/royale/spark/core/IGapLayout.as 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/core/IGapLayout.as
new file mode 100644
index 0000000..400fba0
--- /dev/null
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/core/IGapLayout.as
@@ -0,0 +1,36 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package spark.core
+{      
+       import org.apache.royale.core.IBeadLayout;
+       
+       /**
+        * IGapLayout layouts have a fixed gap between layout items
+        *  
+        *  @langversion 3.0
+        *  @playerversion Flash 10.2
+        *  @playerversion AIR 2.6
+        *  @productversion Royale 0.9.7
+        */
+       public interface IGapLayout extends IBeadLayout
+       {
+               function get gap():int;
+               function set gap(value:int):void;
+       }
+}
\ No newline at end of file
diff --git 
a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/HorizontalLayout.as
 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/HorizontalLayout.as
index 1bf83a3..daec7e3 100644
--- 
a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/HorizontalLayout.as
+++ 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/HorizontalLayout.as
@@ -36,6 +36,7 @@ import spark.layouts.supportClasses.LinearLayoutVector;
 import org.apache.royale.events.Event;
 import org.apache.royale.geom.Point;
 import org.apache.royale.geom.Rectangle;
+import spark.core.IGapLayout;
 
 use namespace mx_internal;
 
@@ -122,7 +123,7 @@ use namespace mx_internal;
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class HorizontalLayout extends LayoutBase
+public class HorizontalLayout extends LayoutBase implements IGapLayout
 {
 //    include "../core/Version.as";
 
diff --git 
a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/VerticalLayout.as
 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/VerticalLayout.as
index 1e28805..d77e50d 100644
--- 
a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/VerticalLayout.as
+++ 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/VerticalLayout.as
@@ -37,6 +37,7 @@ import spark.layouts.supportClasses.DropLocation;
 import spark.layouts.supportClasses.LayoutBase;
 import spark.layouts.supportClasses.LayoutElementHelper;
 import spark.layouts.supportClasses.LinearLayoutVector;
+import spark.core.IGapLayout;
 
 use namespace mx_internal;
 
@@ -123,7 +124,7 @@ use namespace mx_internal;
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class VerticalLayout extends LayoutBase
+public class VerticalLayout extends LayoutBase implements IGapLayout
 {
 //    include "../core/Version.as";
     

Reply via email to