This is an automated email from the ASF dual-hosted git repository.
Harbs 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 db51a5557f For binding which changes values after the initial style
compute, we need to trigger a new compute
db51a5557f is described below
commit db51a5557f1839e2a6cbaa3537241cf2c004f90d
Author: Harbs <[email protected]>
AuthorDate: Fri Jul 10 13:56:10 2026 +0300
For binding which changes values after the initial style compute, we need
to trigger a new compute
---
.../royale/org/apache/royale/style/IStyleUIBase.as | 1 +
.../royale/org/apache/royale/style/StyleUIBase.as | 19 +++++++++++++++++++
.../apache/royale/style/stylebeads/LeafStyleBase.as | 10 +++++++++-
3 files changed, 29 insertions(+), 1 deletion(-)
diff --git
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/IStyleUIBase.as
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/IStyleUIBase.as
index e1c4947529..50dedcf69b 100644
---
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/IStyleUIBase.as
+++
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/IStyleUIBase.as
@@ -34,6 +34,7 @@ package org.apache.royale.style
function toggleClass(classNameVal:String,add:Boolean):void;
function addStyleBead(bead:IStyleBead):void;
function setStyles(styles:Array, overrideExisting:Boolean =
false):void;
+ function stylesChanged():void;
function setStyle(property:String, value:Object):void;
function toggleAttribute(name:String, value:Boolean):void;
function setAttribute(name:String, value:*):void;
diff --git
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/StyleUIBase.as
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/StyleUIBase.as
index ec6abe41bc..b24bcad0dd 100644
---
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/StyleUIBase.as
+++
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/StyleUIBase.as
@@ -349,6 +349,25 @@ package org.apache.royale.style
* Used to prevent multiple setting of the style classes when
internally setting styles and skins
*/
private var refreshSuspended:Boolean;
+ private var refreshPending:Boolean;
+ public function stylesChanged():void
+ {
+ if(refreshPending)
+ return;
+ refreshPending = true;
+ COMPILE::JS
+ {
+ requestAnimationFrame(function():void{
+ refreshPending = false;
+ refreshStyles();
+ });
+ }
+ COMPILE::SWF
+ {
+ refreshPending = false;
+ refreshStyles();
+ }
+ }
protected function refreshStyles():void
{
if(refreshSuspended)
diff --git
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/LeafStyleBase.as
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/LeafStyleBase.as
index 5c71c7e78c..4d25faf81e 100644
---
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/LeafStyleBase.as
+++
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/LeafStyleBase.as
@@ -19,6 +19,7 @@
package org.apache.royale.style.stylebeads
{
import org.apache.royale.debugging.assert;
+ import org.apache.royale.style.IStyleUIBase;
import org.apache.royale.style.util.CSSLookup;
import org.apache.royale.style.util.StyleData;
import org.apache.royale.style.util.ThemeManager;
@@ -159,10 +160,17 @@ package org.apache.royale.style.stylebeads
{
return _calculatedSelector;
}
-
+ /**
+ * @royaleignorecoercion org.apache.royale.style.IStyleUIBase
+ */
protected function set calculatedSelector(value:String):void
{
_calculatedSelector = sanitizeSelector(value);
+ if(_strand)
+ {
+ assert(_strand is IStyleUIBase, "LeafStyleBase
can only be used with IStyleUIBase");
+ (_strand as IStyleUIBase).stylesChanged();
+ }
}
protected var calculatedRuleValue:String;
public function getSelector():String