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 0296d24 jewel-application: avoid j|Application in CSS since it does
not allow load css rules at runtime, and make Application inherit from
StyledUIBase since ApplicationBase is not coherent with the rest of UI objects
and lack some properties and functionality
0296d24 is described below
commit 0296d24d91dc57deccd140944b0258ab9ba193a9
Author: Carlos Rovira <[email protected]>
AuthorDate: Sat Jan 4 17:53:30 2020 +0100
jewel-application: avoid j|Application in CSS since it does not allow load
css rules at runtime, and make Application inherit from StyledUIBase since
ApplicationBase is not coherent with the rest of UI objects and lack some
properties and functionality
---
.../royale/TourDeJewel/src/main/royale/App.mxml | 4 +
.../royale/org/apache/royale/jewel/Application.as | 118 ++++++++-------------
.../JewelTheme/src/main/resources/defaults.css | 2 +-
.../themes/JewelTheme/src/main/sass/_global.sass | 3 +-
4 files changed, 49 insertions(+), 78 deletions(-)
diff --git a/examples/royale/TourDeJewel/src/main/royale/App.mxml
b/examples/royale/TourDeJewel/src/main/royale/App.mxml
index ed3cf1e..4c248f4 100644
--- a/examples/royale/TourDeJewel/src/main/royale/App.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/App.mxml
@@ -26,11 +26,15 @@
<fx:Script>
<![CDATA[
import
org.apache.royale.jewel.beads.validators.Validator;
+ import org.apache.royale.utils.css.loadCSS;
public function setUp():void
{
// you can change language here
//Validator.locale = "es_ES";
+ //
loadCSS("assets/themes/Jewel-Light-NoFlat-Primary-Blue-Theme/defaults.css")
+ //
loadCSS("assets/themes/Jewel-Light-NoFlat-Secondary-Topaz-Theme/defaults.css")
+ //
loadCSS("assets/themes/Jewel-Light-NoFlat-Emphasized-Emerald-Theme/defaults.css")
}
]]>
</fx:Script>
diff --git
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Application.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Application.as
index 1a646ed..b9cb769 100644
---
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Application.as
+++
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Application.as
@@ -50,6 +50,8 @@ package org.apache.royale.jewel
import org.apache.royale.events.IEventDispatcher;
import org.apache.royale.utils.MXMLDataInterpreter;
import org.apache.royale.utils.Timer;
+ import org.apache.royale.core.StyledUIBase;
+ import org.apache.royale.core.IFlexInfo;
//--------------------------------------
@@ -125,7 +127,7 @@ package org.apache.royale.jewel
* @playerversion AIR 2.6
* @productversion Royale 0.9.4
*/
- public class Application extends ApplicationBase implements IStrand,
IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost,
IPopUpHostParent, IRenderedObject
+ public class Application extends StyledUIBase implements IStrand, IParent,
IEventDispatcher, IInitialViewApplication, IPopUpHost, IPopUpHostParent,
IRenderedObject, IFlexInfo
{
/**
* Constructor.
@@ -139,17 +141,19 @@ package org.apache.royale.jewel
{
super();
- COMPILE::SWF {
- if (stage)
- {
- stage.align = StageAlign.TOP_LEFT;
- stage.scaleMode = StageScaleMode.NO_SCALE;
- // should be opt-in
- //stage.quality =
StageQuality.HIGH_16X16_LINEAR;
- }
-
- loaderInfo.addEventListener(flash.events.Event.INIT,
initHandler);
- }
+
+
+ // COMPILE::SWF {
+ // if (stage)
+ // {
+ // stage.align = StageAlign.TOP_LEFT;
+ // stage.scaleMode = StageScaleMode.NO_SCALE;
+ // // should be opt-in
+ // //stage.quality =
StageQuality.HIGH_16X16_LINEAR;
+ // }
+
+ // loaderInfo.addEventListener(flash.events.Event.INIT,
initHandler);
+ // }
COMPILE::JS {
element =
document.getElementsByTagName('body')[0];
element.className = 'Application';
@@ -157,6 +161,22 @@ package org.apache.royale.jewel
this.valuesImpl = new AllCSSValuesImpl();
}
+
+ private var _info:Object;
+
+ /**
+ * An Object containing information generated
+ * by the compiler that is useful at startup time.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public function info():Object
+ {
+ return _info;
+ }
protected var instanceParent:IParent = null;
@@ -427,7 +447,7 @@ package org.apache.royale.jewel
*
* @royalesuppresspublicvarwarning
*/
- public var beads:Array;
+ // public var beads:Array;
COMPILE::SWF
private var _beads:Vector.<IBead>;
@@ -493,36 +513,6 @@ package org.apache.royale.jewel
}
/**
- * @copy org.apache.royale.core.IParent#addElement()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion Royale 0.9.4
- * @royaleignorecoercion org.apache.royale.core.IUIBase
- * @royaleignorecoercion HTMLElement
- */
- public function addElement(c:IChild, dispatchEvent:Boolean = true):void
- {
- COMPILE::SWF {
- if (c is IUIBase)
- {
- if (c is IRenderedObject)
- addChild(IRenderedObject(c).$displayObject);
- else
- addChild(c as DisplayObject);
- IUIBase(c).addedToParent();
- }
- else
- addChild(c as DisplayObject);
- }
- COMPILE::JS {
- element.appendChild(c.positioner);
- (c as IUIBase).addedToParent();
- }
- }
-
- /**
* @copy org.apache.royale.core.IParent#addElementAt()
*
* @langversion 3.0
@@ -531,7 +521,7 @@ package org.apache.royale.jewel
* @productversion Royale 0.9.4
* @royaleignorecoercion org.apache.royale.core.IUIBase
*/
- public function addElementAt(c:IChild, index:int,
dispatchEvent:Boolean = true):void
+ override public function addElementAt(c:IChild, index:int,
dispatchEvent:Boolean = true):void
{
COMPILE::SWF {
if (c is IUIBase)
@@ -546,7 +536,7 @@ package org.apache.royale.jewel
addChildAt(c as DisplayObject, index);
}
COMPILE::JS {
- var children:NodeList = internalChildren();
+ var children:NodeList = internalChildrenNodeList();
if (index >= children.length)
addElement(c);
else
@@ -567,13 +557,13 @@ package org.apache.royale.jewel
* @playerversion AIR 2.6
* @productversion Royale 0.9.4
*/
- public function getElementAt(index:int):IChild
+ override public function getElementAt(index:int):IChild
{
COMPILE::SWF {
return getChildAt(index) as IChild;
}
COMPILE::JS {
- var children:NodeList = internalChildren();
+ var children:NodeList = internalChildrenNodeList();
return children[index].royale_wrapper;
}
}
@@ -586,7 +576,7 @@ package org.apache.royale.jewel
* @playerversion AIR 2.6
* @productversion Royale 0.9.4
*/
- public function getElementIndex(c:IChild):int
+ override public function getElementIndex(c:IChild):int
{
COMPILE::SWF {
if (c is IRenderedObject)
@@ -595,7 +585,7 @@ package org.apache.royale.jewel
return getChildIndex(c as DisplayObject);
}
COMPILE::JS {
- var children:NodeList = internalChildren();
+ var children:NodeList = internalChildrenNodeList();
var n:int = children.length;
for (var i:int = 0; i < n; i++)
{
@@ -607,30 +597,6 @@ package org.apache.royale.jewel
}
/**
- * @copy org.apache.royale.core.IParent#removeElement()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion Royale 0.9.4
- * @royaleignorecoercion HTMLElement
- */
- public function removeElement(c:IChild, dispatchEvent:Boolean =
true):void
- {
- COMPILE::SWF {
- if (c is IRenderedObject)
- {
- removeChild(IRenderedObject(c).$displayObject);
- }
- else
- removeChild(c as DisplayObject);
- }
- COMPILE::JS {
- element.removeChild(c.element as HTMLElement);
- }
- }
-
- /**
* @copy org.apache.royale.core.IParent#numElements
*
* @langversion 3.0
@@ -638,13 +604,13 @@ package org.apache.royale.jewel
* @playerversion AIR 2.6
* @productversion Royale 0.9.4
*/
- public function get numElements():int
+ override public function get numElements():int
{
COMPILE::SWF {
return numChildren;
}
COMPILE::JS {
- var children:NodeList = internalChildren();
+ var children:NodeList = internalChildrenNodeList();
return children.length;
}
}
@@ -653,7 +619,7 @@ package org.apache.royale.jewel
* @return {Object} The array of children.
*/
COMPILE::JS
- protected function internalChildren():NodeList
+ protected function internalChildrenNodeList():NodeList
{
return element.childNodes;
};
diff --git a/frameworks/themes/JewelTheme/src/main/resources/defaults.css
b/frameworks/themes/JewelTheme/src/main/resources/defaults.css
index 051d7a7..d513c62 100644
--- a/frameworks/themes/JewelTheme/src/main/resources/defaults.css
+++ b/frameworks/themes/JewelTheme/src/main/resources/defaults.css
@@ -16,7 +16,7 @@
*/
@namespace j "library://ns.apache.org/royale/jewel";
@namespace "http://www.w3.org/1999/xhtml";
-j|Application {
+body {
background: white;
font-family: "Lato", sans-serif;
color: #808080;
diff --git a/frameworks/themes/JewelTheme/src/main/sass/_global.sass
b/frameworks/themes/JewelTheme/src/main/sass/_global.sass
index 0330d1e..1c35e05 100644
--- a/frameworks/themes/JewelTheme/src/main/sass/_global.sass
+++ b/frameworks/themes/JewelTheme/src/main/sass/_global.sass
@@ -20,7 +20,8 @@
@namespace j "library://ns.apache.org/royale/jewel"
@namespace "http://www.w3.org/1999/xhtml"
-j|Application
+//j|Application
+body
background: $background-color
font:
family: $font-stack