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 2018/03/29 20:18:22 UTC
[royale-asjs] branch feature/jewel-ui-set updated: fixes to local
UIBase to work with layout performance branch
This is an automated email from the ASF dual-hosted git repository.
carlosrovira pushed a commit to branch feature/jewel-ui-set
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/feature/jewel-ui-set by this push:
new db28b01 fixes to local UIBase to work with layout performance branch
db28b01 is described below
commit db28b017c45d8a6340a2d59ca116af6f09126861
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Thu Mar 29 22:18:18 2018 +0200
fixes to local UIBase to work with layout performance branch
---
.../projects/Jewel/src/main/resources/defaults.css | 5 +-
.../main/royale/org/apache/royale/core/UIBase.as | 87 ++++++++++++++--------
2 files changed, 56 insertions(+), 36 deletions(-)
diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index b494eea..94135ab 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -40,10 +40,7 @@
min-height: 210px;
max-width: 100%;
max-height: 100%;
- box-shadow: 0px 6px 60px -10px rgba(112, 112, 112, 0.7);
- background-color: #FFFFFF;
- border: 0px solid;
- border-radius: 10px;
+ z-index: 1000;
}
.jewel.alert .jewel.titlebar {
padding: 20px 20px 0px 20px;
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/core/UIBase.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/core/UIBase.as
index 7b37fab..f59d7f0 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/core/UIBase.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/core/UIBase.as
@@ -396,6 +396,8 @@ package org.apache.royale.core
COMPILE::JS
public function get width():Number
{
+ if(!isNaN(_explicitWidth))
+ return _explicitWidth;
var pixels:Number;
var strpixels:String = element.style.width as String;
if(strpixels == null)
@@ -488,6 +490,8 @@ package org.apache.royale.core
COMPILE::JS
public function get height():Number
{
+ if(!isNaN(_explicitHeight))
+ return _explicitHeight;
var pixels:Number;
var strpixels:String = element.style.height as String;
if(strpixels == null)
@@ -590,6 +594,37 @@ package org.apache.royale.core
dispatchEvent(new Event("widthChanged"));
}
}
+
+ /**
+ * @private
+ * Used by layout to prevent causing unnecessary reflows when measuring.
+ */
+ private var _measuredWidth:Number;
+
+ public function get measuredWidth():Number
+ {
+ return _measuredWidth;
+ }
+
+ public function set measuredWidth(value:Number):void
+ {
+ _measuredWidth = value;
+ }
+ /**
+ * @private
+ * Used by layout to prevent causing unnecessary reflows when measuring.
+ */
+ private var _measuredHeight:Number;
+
+ public function get measuredHeight():Number
+ {
+ return _measuredHeight;
+ }
+
+ public function set measuredHeight(value:Number):void
+ {
+ _measuredHeight = value;
+ }
/**
* @copy org.apache.royale.core.ILayoutChild#setWidthAndHeight
@@ -677,17 +712,14 @@ package org.apache.royale.core
else
style.left = value;
}
-
/**
* @royaleignorecoercion HTMLElement
*/
COMPILE::JS
public function set x(value:Number):void
{
- //positioner.style.position = 'absolute';
- if (positioner.parentNode != positioner.offsetParent)
- value += (positioner.parentNode as HTMLElement).offsetLeft;
- positioner.style.left = value.toString() + 'px';
+ _x = value;
+ setX(value);
}
/**
@@ -697,6 +729,8 @@ package org.apache.royale.core
COMPILE::JS
public function get x():Number
{
+ if(!isNaN(_x))
+ return _x
var strpixels:String = positioner.style.left as String;
var pixels:Number = parseFloat(strpixels);
if (isNaN(pixels))
@@ -753,10 +787,8 @@ package org.apache.royale.core
COMPILE::JS
public function set y(value:Number):void
{
- //positioner.style.position = 'absolute';
- if (positioner.parentNode != positioner.offsetParent)
- value += (positioner.parentNode as HTMLElement).offsetTop;
- positioner.style.top = value.toString() + 'px';
+ _y = value;
+ setY(value);
}
/**
@@ -766,6 +798,8 @@ package org.apache.royale.core
COMPILE::JS
public function get y():Number
{
+ if(!isNaN(_y))
+ return _y
var strpixels:String = positioner.style.top as String;
var pixels:Number = parseFloat(strpixels);
if (isNaN(pixels))
@@ -918,6 +952,7 @@ package org.apache.royale.core
* @playerversion AIR 2.6
* @productversion Royale 0.0
* @royaleignorecoercion Class
+ * @royaleignorecoercion org.apache.royale.core.IBeadView
*/
public function get view():IBeadView
{
@@ -933,7 +968,7 @@ package org.apache.royale.core
{
if (_view != value)
{
- addBead(value as IBead);
+ addBead(value);
dispatchEvent(new Event("viewChanged"));
}
}
@@ -1062,33 +1097,18 @@ package org.apache.royale.core
}
}
- /**
- * Computes the final syles for this component joining typeNames and classNames
- * styles
- *
- * @langversion 3.0
- * @productversion Royale 0.9.3
- */
- COMPILE::JS
+ COMPILE::JS
protected function computeFinalClassNames():String
{
return StringUtil.trim((_className ? _className : "") + " " + (typeNames ? typeNames : ""));
}
-
- /**
- * Sets the component styles in JS
- *
- * @langversion 3.0
- * @productversion Royale 0.0
- */
COMPILE::JS
protected function setClassName(value:String):void
{
- addStyles(element, value);
+ addStyles(element, value);
}
-
/**
* @copy org.apache.royale.core.IUIBase#element
*
@@ -1124,7 +1144,9 @@ package org.apache.royale.core
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
- * @productversion Royale 0.0
+ * @productversion Royale 0.9
+ * @royaleignorecoercion org.apache.royale.core.IBeadModel
+ * @royaleignorecoercion org.apache.royale.core.IBeadView
*/
override public function addBead(bead:IBead):void
{
@@ -1142,7 +1164,7 @@ package org.apache.royale.core
bead.strand = this;
if (isView) {
- IEventDispatcher(this).dispatchEvent(new Event("viewChanged"));
+ dispatchEvent(new Event("viewChanged"));
}
}
@@ -1375,9 +1397,9 @@ package org.apache.royale.core
COMPILE::JS
{
- setClassName(computeFinalClassNames());
+ setClassName(computeFinalClassNames());
- if (style)
+ if (style)
ValuesManager.valuesImpl.applyStyles(this, style);
}
@@ -1441,7 +1463,8 @@ package org.apache.royale.core
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
- * @productversion Royale 0.0
+ * @productversion Royale 0.9
+ * @royaleignorecoercion org.apache.royale.core.IMeasurementBead
*/
public function get measurementBead() : IMeasurementBead
{
--
To stop receiving notification emails like this one, please contact
carlosrovira@apache.org.