You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2026/04/01 07:10:24 UTC
(royale-asjs) branch develop updated (379e23c0c0 -> f2dffe7fdc)
This is an automated email from the ASF dual-hosted git repository.
gregdove pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
from 379e23c0c0 Fixed List
new 9f9032f0cb simplify Checkbox for now - remove labelPlacement support, and use PeerPseudo where possible in skin.
new aa08de07b0 we have decided to skip 'quiet' support on Style components.
new ac5b26047e constructor sweep with extra tweaks and updates in numerous composites and leaves.
new 473d7df2b4 unit propagation.
new f2dffe7fdc Improvements in Divider. Followed Checkbox more to separate the divider line and the edge padding. (tried :after, but that seems like it is discouraged)
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../royale/org/apache/royale/style/CheckBox.as | 39 +-
.../main/royale/org/apache/royale/style/Divider.as | 41 +-
.../org/apache/royale/style/skins/CheckBoxSkin.as | 173 ++----
.../org/apache/royale/style/skins/DividerSkin.as | 107 ++--
.../skins/{IAccordionSkin.as => IDividerSkin.as} | 6 +-
.../royale/style/stylebeads/StyleBeadBase.as | 13 +
.../royale/style/stylebeads/border/Border.as | 607 ++++++++++++++++++++-
.../royale/style/stylebeads/border/BorderColor.as | 9 +-
.../royale/style/stylebeads/border/BorderRadius.as | 3 +-
.../royale/style/stylebeads/border/BorderStyle.as | 19 +-
.../royale/style/stylebeads/border/BorderWidth.as | 3 +-
.../royale/style/stylebeads/border/Outline.as | 36 +-
.../royale/style/stylebeads/flexgrid/Flex.as | 2 +-
.../royale/style/stylebeads/flexgrid/FlexBasis.as | 9 +-
.../stylebeads/layout/{Isolation.as => Content.as} | 16 +-
.../royale/style/stylebeads/spacing/Margin.as | 6 +-
.../royale/style/stylebeads/spacing/Padding.as | 4 +-
.../royale/style/stylebeads/states/ActiveState.as | 4 +-
.../royale/style/stylebeads/states/FocusState.as | 4 +-
.../style/stylebeads/states/RequiredState.as | 4 +-
.../style/stylebeads/states/attribute/AriaState.as | 4 +-
.../stylebeads/states/attribute/InertState.as | 4 +-
.../style/stylebeads/states/attribute/OpenState.as | 4 +-
.../style/stylebeads/states/attribute/RTLState.as | 4 +-
.../style/stylebeads/states/pseudo/AfterState.as | 4 +-
.../stylebeads/states/pseudo/BackdropState.as | 4 +-
.../style/stylebeads/states/pseudo/BeforeState.as | 4 +-
.../style/stylebeads/states/pseudo/FileState.as | 4 +-
.../stylebeads/states/pseudo/FirstLetterState.as | 6 +-
.../stylebeads/states/pseudo/FirstLineState.as | 6 +-
.../style/stylebeads/states/pseudo/MarkerState.as | 4 +-
.../stylebeads/states/pseudo/PlaceholderState.as | 4 +-
.../stylebeads/states/pseudo/SelectionState.as | 4 +-
33 files changed, 862 insertions(+), 299 deletions(-)
copy frameworks/projects/Style/src/main/royale/org/apache/royale/style/skins/{IAccordionSkin.as => IDividerSkin.as} (91%)
copy frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/layout/{Isolation.as => Content.as} (78%)
(royale-asjs) 02/05: we have decided to skip 'quiet' support on Style components.
Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit aa08de07b03a14a14667ffedbdf780f92c5647c3
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Apr 1 15:56:01 2026 +1300
we have decided to skip 'quiet' support on Style components.
---
.../src/main/royale/org/apache/royale/style/CheckBox.as | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/CheckBox.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/CheckBox.as
index 3af1b9cee0..707a89f8c1 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/CheckBox.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/CheckBox.as
@@ -306,23 +306,6 @@ package org.apache.royale.style
}
}
}
- private var _quiet:Boolean;
- /**
- * When true, the CheckBox will have a quieter appearance with less visual emphasis. This can be used when the CheckBox is part of a group of related options to reduce visual noise.
- * The Checkbox skin should specify styles for the quiet state if it should look different than the regular state. This might include things like lighter colors, smaller size, or less prominent check icons.
- *
- * @languageversion 3.0
- * @productversion Royale 1.0.0
- */
- public function get quiet():Boolean
- {
- return _quiet;
- }
-
- public function set quiet(value:Boolean):void
- {
- _quiet = value;
- }
/**
* @copy org.apache.royale.style.StyleUIBase#getWrapperStyle()
(royale-asjs) 01/05: simplify Checkbox for now - remove labelPlacement support, and use PeerPseudo where possible in skin.
Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 9f9032f0cbabded8e1a8cf57beae1b683365d6ee
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Apr 1 15:51:20 2026 +1300
simplify Checkbox for now - remove labelPlacement support, and use PeerPseudo where possible in skin.
---
.../royale/org/apache/royale/style/CheckBox.as | 22 +--
.../org/apache/royale/style/skins/CheckBoxSkin.as | 173 +++++++--------------
2 files changed, 57 insertions(+), 138 deletions(-)
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/CheckBox.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/CheckBox.as
index b88f73c29f..3af1b9cee0 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/CheckBox.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/CheckBox.as
@@ -50,27 +50,7 @@ package org.apache.royale.style
//we could use the following for a generic name, or override getWrapperStyle with something specific
//useWrapperStyle = true;
}
- private var _labelPlacement:String = "right";
- [Bindable(event='valueChange',type='org.apache.royale.events.ValueChangeEvent')]
- public function get labelPlacement():String
- {
- return _labelPlacement;
- }
- [Inspectable(category="General", enumeration="left,right,top,bottom")]
- public function set labelPlacement(value:String):void
- {
- if(_labelPlacement != value){
- var oldVal:String = _labelPlacement;
- _labelPlacement = value;
- if(_stylesLoaded)
- {
- if (skin is ICheckBoxSkin)
- (skin as ICheckBoxSkin).updateStyles();
- applySkin();
- }
- dispatchEvent(ValueChangeEvent.createUpdateEvent(this,'labelPlacement',oldVal,value))
- }
- }
+
COMPILE::JS
private var input:HTMLInputElement;
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/skins/CheckBoxSkin.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/skins/CheckBoxSkin.as
index 21b3b275b0..6441c6351d 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/skins/CheckBoxSkin.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/skins/CheckBoxSkin.as
@@ -46,6 +46,7 @@ package org.apache.royale.style.skins
import org.apache.royale.style.stylebeads.states.LeafDecorator;
import org.apache.royale.style.stylebeads.states.NotState;
import org.apache.royale.style.stylebeads.states.HoverState;
+ import org.apache.royale.style.stylebeads.states.attribute.DataState;
import org.apache.royale.style.util.ThemeManager;
import org.apache.royale.style.stylebeads.border.BorderWidth;
import org.apache.royale.style.stylebeads.border.BorderColor;
@@ -114,56 +115,29 @@ package org.apache.royale.style.skins
var padding:Padding = new Padding();
padding.unit = host.unit;
+ padding.right = gap;
+ var layoutStyles:Array = [
+ new Display("inline-grid"),
+ new VerticalAlign("top"),
+ new GridTemplateColumns(box + " auto"),
+ new GridTemplateRows("auto"),
+ new AlignItems("center"),
+ new ColumnGap(gap),
+ padding
+ ];
- var layoutStyles:Array = [];
- var placement:String = host.labelPlacement;
- if (placement == "top" || placement == "bottom")
- {
- layoutStyles.push(new Display("inline-grid"));
- layoutStyles.push(new VerticalAlign("top"));
- var rowTemplate:String = (placement == "top") ? "auto " + box : box + " auto";
- layoutStyles.push(new GridTemplateRows(rowTemplate));
- layoutStyles.push(new GridTemplateColumns("auto"));
- layoutStyles.push(new JustifyItems("center"));
- layoutStyles.push(new AlignItems("center"));
- layoutStyles.push(new RowGap(gap));
- padding.right = gap;
- }
- else
- {
- layoutStyles.push(new Display("inline-grid"));
- layoutStyles.push(new VerticalAlign("top"));
- var colTemplate:String = (placement == "left") ? "auto " + box : box + " auto";
- layoutStyles.push(new GridTemplateColumns(colTemplate));
- layoutStyles.push(new GridTemplateRows("auto"));
- layoutStyles.push(new AlignItems("center"));
- layoutStyles.push(new ColumnGap(gap));
- padding.right = gap;
- }
-
- // Style components often use a "group" pattern where the wrapper element
- // (usually a label) holds the state (like data-disabled), and child elements
- // (box, icon, text) respond to that state.
- //
- // By default, the wrapper has the 'style-group' class, but this can be specific via override (e.g. 'checkbox')
- // host.getWrapperStyle() provides this class name to GroupPseudo.
-
- var disabledState:AttributeState = new AttributeState("data-disabled", [
- new Cursor("auto")
- ]);
-
_styles = [
new UserSelect("none"),
new Cursor("pointer"),
- padding,
- disabledState
+ new DataState("disabled", [
+ new Cursor("auto")
+ ])
].concat(layoutStyles);
host.setStyles(_styles, true);
}
private function getMultiplier():Number
{
- var multiple:Number;
switch(host.size)
{
case "sm":
@@ -200,23 +174,9 @@ package org.apache.royale.style.skins
var size:Number = 16 * getMultiplier();
var box:String = computeSize(size * 1.25, host.unit);
- var boxColumn:String = "1";
- var boxRow:String = "1";
- var placement:String = host.labelPlacement;
- if (placement == "top") {
- boxRow = "2";
- boxColumn = "1";
- } else if (placement == "left") {
- boxColumn = "2";
- boxRow = "1";
- } else if (placement == "bottom") {
- boxRow = "1";
- boxColumn = "1";
- } else { // right
- boxColumn = "1";
- boxRow = "1";
- }
-
+ var boxColumn:String = "1";// the grid column to place the box in
+ var boxRow:String = "1";// the grid row to place the box in
+
var outline:Outline = new Outline();
outline.unit = host.unit;
outline.width = 0.5;
@@ -243,17 +203,23 @@ package org.apache.royale.style.skins
new IndeterminateState([
new BorderColor(primaryColor),
new BackgroundColor(primaryColor)
+ ]),
+ new DisabledState([
+ new BorderColor(disabledBorder),
+ new BackgroundColor(disabledFillColor)
])
- ]),
+ ])/*,
+
+ //for reference, this also works instead of PeerPseudo/DisabledState above:
// Apply disabled styles when the parent (wrapper) is disabled.
// host.getWrapperStyle() ensures this matches the component's top-level class.
// This is added at the end so it has higher priority in CSS than PeerPseudo styles.
new GroupPseudo([
- new AttributeState("data-disabled", [
+ new DataState("disabled", [
new BorderColor(disabledBorder),
new BackgroundColor(disabledFillColor)
])
- ], host.getWrapperStyle())
+ ], host.getWrapperStyle())*/
];
}
@@ -277,34 +243,26 @@ package org.apache.royale.style.skins
var enabledColor:ColorSwatch = colorSet.baseContent;
var disabledColor:ColorSwatch = colorSet.baseContentWeak;
- var labelColumn:String = "2";
- var labelRow:String = "1";
- var placement:String = host.labelPlacement;
- if (placement == "top") {
- labelColumn = "1";
- labelRow = "1";
- } else if (placement == "bottom") {
- labelColumn = "1";
- labelRow = "2";
- } else if (placement == "left") {
- labelColumn = "1";
- labelRow = "1";
- } else { // right
- labelColumn = "2";
- labelRow = "1";
- }
-
+ var labelColumn:String = "2"; // the grid column to place the label in
+ var labelRow:String = "1"; // the grid row to place the label in
+
_labelStyles = [
new GridColumnStart(labelColumn),
new GridRowStart(labelRow),
new FontSize(fontSize),
new FontWeight("600"),
new TextColor(enabledColor),
+ new PeerPseudo([
+ new DisabledState([
+ new TextColor(disabledColor)
+ ])
+ ])/*
+ //for reference, this also works instead of PeerPseudo/DisabledState above:
new GroupPseudo([
- new AttributeState("data-disabled", [
+ new DataState("disabled", [
new TextColor(disabledColor)
])
- ], host.getWrapperStyle())
+ ], host.getWrapperStyle())*/
];
}
@@ -329,22 +287,8 @@ package org.apache.royale.style.skins
_checkIcon = new Div();
var size:Number = 16 * getMultiplier();
- var boxColumn:String = "1";
- var boxRow:String = "1";
- var placement:String = host.labelPlacement;
- if (placement == "top") {
- boxRow = "2";
- boxColumn = "1";
- } else if (placement == "left") {
- boxColumn = "2";
- boxRow = "1";
- } else if (placement == "bottom") {
- boxRow = "1";
- boxColumn = "1";
- } else { // right
- boxColumn = "1";
- boxRow = "1";
- }
+ var boxColumn:String = "1"; // the grid column to place the icon in
+ var boxRow:String = "1"; // the grid row to place the icon in
var transform:Transform = new Transform();
transform.rotate = "45deg";
@@ -372,13 +316,17 @@ package org.apache.royale.style.skins
]),
new IndeterminateState([
new OpacityStyle(0)
+ ]),
+ new DisabledState([
+ new BorderColor(disabledColor)
])
- ]),
+ ])/*,
+ //for reference, this also works instead of PeerPseudo/DisabledState above:
new GroupPseudo([
- new AttributeState("data-disabled", [
+ new DataState("disabled", [
new BorderColor(disabledColor)
])
- ], host.getWrapperStyle())
+ ], host.getWrapperStyle())*/
];
_checkIcon.setStyles(styles);
// TODO dark mode styles
@@ -407,22 +355,8 @@ package org.apache.royale.style.skins
var size:Number = 16 * getMultiplier();
var unit:String = host.unit;
- var boxColumn:String = "1";
- var boxRow:String = "1";
- var placement:String = host.labelPlacement;
- if (placement == "top") {
- boxRow = "2";
- boxColumn = "1";
- } else if (placement == "left") {
- boxColumn = "2";
- boxRow = "1";
- } else if (placement == "bottom") {
- boxRow = "1";
- boxColumn = "1";
- } else { // right
- boxColumn = "1";
- boxRow = "1";
- }
+ var boxColumn:String = "1"; // the grid column to place the icon in
+ var boxRow:String = "1";// the grid row to place the icon in
var styles:Array = [
new GridColumnStart(boxColumn),
@@ -438,13 +372,18 @@ package org.apache.royale.style.skins
new PeerPseudo([
new IndeterminateState([
new OpacityStyle(100)
+ ]),
+ new DisabledState([
+ new BackgroundColor(disabledColor)
])
- ]),
+ ])
+ /*,
+ //for reference, this also works instead of PeerPseudo/DisabledState above:
new GroupPseudo([
- new AttributeState("data-disabled", [
+ new DataState("disabled", [
new BackgroundColor(disabledColor)
])
- ], host.getWrapperStyle())
+ ], host.getWrapperStyle())*/
];
_indeterminateIcon.setStyles(styles);
}
(royale-asjs) 05/05: Improvements in Divider. Followed Checkbox more to separate the divider line and the edge padding. (tried :after, but that seems like it is discouraged)
Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit f2dffe7fdcff8dc4992397c37b68b8c6971c9b4d
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Apr 1 20:09:54 2026 +1300
Improvements in Divider. Followed Checkbox more to separate the divider line and the edge padding. (tried :after, but that seems like it is discouraged)
---
.../main/royale/org/apache/royale/style/Divider.as | 41 +++++++-
.../org/apache/royale/style/skins/DividerSkin.as | 107 ++++++++++++++-------
.../org/apache/royale/style/skins/IDividerSkin.as | 27 ++++++
3 files changed, 138 insertions(+), 37 deletions(-)
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/Divider.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/Divider.as
index e8d142f458..2cd69f941a 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/Divider.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/Divider.as
@@ -18,11 +18,17 @@
////////////////////////////////////////////////////////////////////////////////
package org.apache.royale.style
{
+ COMPILE::JS{
+ import org.apache.royale.core.WrappedHTMLElement;
+ import org.apache.royale.style.elements.Div;
+ }
import org.apache.royale.core.IBead;
import org.apache.royale.core.IMXMLDocument;
import org.apache.royale.core.ValuesManager;
import org.apache.royale.events.Event;
import org.apache.royale.utils.MXMLDataInterpreter;
+ import org.apache.royale.debugging.assert;
+ import org.apache.royale.style.skins.IDividerSkin;
public class Divider extends StyleUIBase
@@ -32,6 +38,7 @@ package org.apache.royale.style
super();
unit = 'px';
}
+
override protected function requiresView():Boolean{
return false;
}
@@ -42,11 +49,41 @@ package org.apache.royale.style
return false;
}*/
+ COMPILE::JS
+ private var _line:Div;
+
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement{
+ var elem:WrappedHTMLElement = super.createElement();
+ _line = new Div();
+ addElement(_line);
+ return elem;
+ }
+
+ /**
+ * The internal line element.
+ */
+ COMPILE::JS
+ public function get line():Div{
+ return _line;
+ }
+
+ override protected function applySkin():void
+ {
+ var divSkin:IDividerSkin = skin as IDividerSkin;
+ assert(divSkin, "Divider requires a skin that implements IDividerSkin");
+ COMPILE::JS
+ {
+ var styles:Array = divSkin.lineStyles || [];
+ _line.setStyles(styles, true);
+ }
+ }
+
private var _edgePadding:Number = 0;
- public function get edgePadding():uint{
+ public function get edgePadding():Number{
return _edgePadding;
}
- public function set edgePadding(value:uint):void{
+ public function set edgePadding(value:Number):void{
if (_edgePadding != value) {
_edgePadding = value;
if (skin) skin.update();
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/skins/DividerSkin.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/skins/DividerSkin.as
index ad9a5e1543..473a2d71f1 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/skins/DividerSkin.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/skins/DividerSkin.as
@@ -28,16 +28,26 @@ package org.apache.royale.style.skins
import org.apache.royale.style.util.ThemeManager;
import org.apache.royale.style.stylebeads.background.BackgroundColor;
- import org.apache.royale.style.Divider;
+ import org.apache.royale.style.stylebeads.flexgrid.AlignItems;
+ import org.apache.royale.style.stylebeads.flexgrid.JustifyContent;
+ import org.apache.royale.style.stylebeads.flexgrid.FlexDirection;
+ import org.apache.royale.style.stylebeads.flexgrid.Flex;
+ import org.apache.royale.style.stylebeads.flexgrid.FlexGrow;
+ import org.apache.royale.style.stylebeads.flexgrid.FlexBasis;
+ import org.apache.royale.style.stylebeads.spacing.Margin;
+ import org.apache.royale.style.stylebeads.layout.Display;
- public class DividerSkin extends StyleSkin /*implements ICheckBoxSkin*/
+ import org.apache.royale.style.Divider;
+
+ public class DividerSkin extends StyleSkin implements IDividerSkin
{
public function DividerSkin()
{
super();
}
+
/**
- * @royaleignorecoercion org.apache.royale.style.CheckBox
+ * @royaleignorecoercion org.apache.royale.style.Divider
*/
private function getHost():Divider
{
@@ -46,6 +56,7 @@ package org.apache.royale.style.skins
override public function set strand(value:IStrand):void
{
super.strand = value;
+
// Manually set. Don't create the default ones.
if(_styles)
return;
@@ -55,49 +66,75 @@ package org.apache.royale.style.skins
override public function update():void{
processStyles()
}
+
+ private var _lineStyles:Array;
+
+ public function get lineStyles():Array
+ {
+ if(!_lineStyles)
+ processStyles();
+ return _lineStyles;
+ }
private function processStyles():void{
var host:Divider = getHost();
- var hostSize:String = getHost().size;
+ var hostSize:String = host.size;
+ var hostUnit:String = host.unit;
var size:Number = getAppliedSize(hostSize);
var colorAdjust:Number = getShading(hostSize);
- var edgePadding:Number = host.edgePadding;
- var appliedSize:String = computeSize(size + edgePadding * 2 , host.unit);
- //edgePadding will be applied with transparent borders;
- var borderPadding:Border
- if (edgePadding) {
- var appliedEdgePadding:String = computeSize(edgePadding,host.unit);
- borderPadding = new Border();
- borderPadding.color = 'transparent';
- }
+ var edgePadding:String = computeSize(host.edgePadding, hostUnit);
- var styles:Array = [
- new BackgroundColor("slate-"+colorAdjust),
- new BorderRadius(ThemeManager.instance.activeTheme.radiusSM),
- ]
- if (borderPadding) {
- styles.push(borderPadding);
- styles.push(new BackgroundClip('padding-box'));
- }
- if (getHost().vertical) {
- styles.push(new HeightStyle('100%'));
- styles.push(new WidthStyle(appliedSize));
- if (borderPadding) {
- //there seems to be no way to configure top and bottom border...tbd
- borderPadding.width = appliedEdgePadding;
- }
+ var appliedSize:String = computeSize(size, hostUnit);
+
+ var hostStyles:Array = [
+ // new BackgroundColor('transparent'), //probably not needed
+ new Display('flex'),
+ new Flex(0),
+ new JustifyContent('center'),
+ new AlignItems('center')
+ ];
+
+ var lineStylesArr:Array = [
+ new BackgroundColor("slate-"+colorAdjust),
+ new BorderRadius(ThemeManager.instance.activeTheme.radiusSM)
+ ];
+
+ lineStylesArr.push(new Display('block')); // Ensure it renders
+
+ if (host.vertical) {
+ hostStyles.push(new FlexDirection('column'));
+ hostStyles.push(new HeightStyle('100%'));
+ lineStylesArr.push(new WidthStyle(appliedSize));
+ lineStylesArr.push(new FlexGrow(1));
+ lineStylesArr.push(new FlexBasis(0));
+
+ if (edgePadding) {
+ var hMargin:Margin = new Margin();
+ hMargin.unit = hostUnit;
+ hMargin.left = edgePadding;
+ hMargin.right = edgePadding;
+ lineStylesArr.push(hMargin);
+ }
} else {
-
- if (borderPadding) {
- //there seems to be no way to configure left and right border...tbd
- borderPadding.width = appliedEdgePadding;
+ hostStyles.push(new FlexDirection('row'));
+ hostStyles.push(new WidthStyle('100%'));
+
+ lineStylesArr.push(new HeightStyle(appliedSize));
+ lineStylesArr.push(new FlexGrow(1));
+ lineStylesArr.push(new FlexBasis(0));
+
+ if (edgePadding) {
+ var vMargin:Margin = new Margin();
+ vMargin.unit = hostUnit;
+ vMargin.top = edgePadding;
+ vMargin.bottom = edgePadding;
+ lineStylesArr.push(vMargin);
}
- styles.push(new WidthStyle('100%'));
- styles.push(new HeightStyle(appliedSize));
}
- _styles = styles;
+ _lineStyles = lineStylesArr;
+ _styles = hostStyles;
host.setStyles(_styles, true);
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/skins/IDividerSkin.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/skins/IDividerSkin.as
new file mode 100644
index 0000000000..907dfcca69
--- /dev/null
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/skins/IDividerSkin.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.royale.style.skins
+{
+ import org.apache.royale.style.IStyleSkin;
+
+ public interface IDividerSkin extends IStyleSkin
+ {
+ function get lineStyles():Array;
+ }
+}
(royale-asjs) 03/05: constructor sweep with extra tweaks and updates in numerous composites and leaves.
Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit ac5b26047e479c8f126ed275bcf993f94b7a8d92
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Apr 1 20:07:34 2026 +1300
constructor sweep with extra tweaks and updates in numerous composites and leaves.
---
.../royale/style/stylebeads/border/Border.as | 607 ++++++++++++++++++++-
.../royale/style/stylebeads/border/BorderColor.as | 9 +-
.../royale/style/stylebeads/border/BorderRadius.as | 3 +-
.../royale/style/stylebeads/border/BorderStyle.as | 19 +-
.../royale/style/stylebeads/border/BorderWidth.as | 3 +-
.../royale/style/stylebeads/border/Outline.as | 36 +-
.../royale/style/stylebeads/flexgrid/Flex.as | 2 +-
.../royale/style/stylebeads/flexgrid/FlexBasis.as | 9 +-
.../{border/BorderColor.as => layout/Content.as} | 22 +-
.../royale/style/stylebeads/spacing/Margin.as | 6 +-
.../royale/style/stylebeads/spacing/Padding.as | 4 +-
.../royale/style/stylebeads/states/ActiveState.as | 4 +-
.../royale/style/stylebeads/states/FocusState.as | 4 +-
.../style/stylebeads/states/RequiredState.as | 4 +-
.../style/stylebeads/states/attribute/AriaState.as | 4 +-
.../stylebeads/states/attribute/InertState.as | 4 +-
.../style/stylebeads/states/attribute/OpenState.as | 4 +-
.../style/stylebeads/states/attribute/RTLState.as | 4 +-
.../style/stylebeads/states/pseudo/AfterState.as | 4 +-
.../stylebeads/states/pseudo/BackdropState.as | 4 +-
.../style/stylebeads/states/pseudo/BeforeState.as | 4 +-
.../style/stylebeads/states/pseudo/FileState.as | 4 +-
.../stylebeads/states/pseudo/FirstLetterState.as | 6 +-
.../stylebeads/states/pseudo/FirstLineState.as | 6 +-
.../style/stylebeads/states/pseudo/MarkerState.as | 4 +-
.../stylebeads/states/pseudo/PlaceholderState.as | 4 +-
.../stylebeads/states/pseudo/SelectionState.as | 4 +-
27 files changed, 681 insertions(+), 107 deletions(-)
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/Border.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/Border.as
index 6281925407..92a5262ffa 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/Border.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/Border.as
@@ -33,10 +33,19 @@ package org.apache.royale.style.stylebeads.border
*/
public class Border extends CompositeStyle
{
- public function Border()
+ public function Border(color:String = null, style:String = null, width:* = null, radius:* = null, unit:String = "px")
{
super();
styles = [];
+ this.unit = unit;
+ if(color != this.color)
+ this.color = color;
+ if(style != this.style)
+ this.style = style;
+ if(width != this.width)
+ this.width = width;
+ if(radius != this.radius)
+ this.radius = radius;
}
private var _color:String;
@@ -44,17 +53,177 @@ package org.apache.royale.style.stylebeads.border
{
return _color;
}
- private var colorStyle:Color;
+ private var colorStyle:BorderColor;
public function set color(value:String):void
{
if(!colorStyle)
{
- colorStyle = new Color();
+ colorStyle = new BorderColor();
styles.push(colorStyle);
}
colorStyle.value = value;
_color = value;
}
+ private var _topColor:String;
+ public function get topColor():String
+ {
+ return _topColor;
+ }
+ private var topColorStyle:BorderColor;
+ public function set topColor(value:String):void
+ {
+ if(!topColorStyle)
+ {
+ topColorStyle = new BorderColor("border-t", "border-top-color");
+ styles.push(topColorStyle);
+ }
+ topColorStyle.value = value;
+ _topColor = value;
+ }
+ private var _bottomColor:String;
+ public function get bottomColor():String
+ {
+ return _bottomColor;
+ }
+ private var bottomColorStyle:BorderColor;
+ public function set bottomColor(value:String):void
+ {
+ if(!bottomColorStyle)
+ {
+ bottomColorStyle = new BorderColor("border-b", "border-bottom-color");
+ styles.push(bottomColorStyle);
+ }
+ bottomColorStyle.value = value;
+ _bottomColor = value;
+ }
+ private var _leftColor:String;
+ public function get leftColor():String
+ {
+ return _leftColor;
+ }
+ private var leftColorStyle:BorderColor;
+ public function set leftColor(value:String):void
+ {
+ if(!leftColorStyle)
+ {
+ leftColorStyle = new BorderColor("border-l", "border-left-color");
+ styles.push(leftColorStyle);
+ }
+ leftColorStyle.value = value;
+ _leftColor = value;
+ }
+ private var _rightColor:String;
+ public function get rightColor():String
+ {
+ return _rightColor;
+ }
+ private var rightColorStyle:BorderColor;
+ public function set rightColor(value:String):void
+ {
+ if(!rightColorStyle)
+ {
+ rightColorStyle = new BorderColor("border-r", "border-right-color");
+ styles.push(rightColorStyle);
+ }
+ rightColorStyle.value = value;
+ _rightColor = value;
+ }
+ private var _blockColor:String;
+ public function get blockColor():String
+ {
+ return _blockColor;
+ }
+ private var blockColorStyle:BorderColor;
+ public function set blockColor(value:String):void
+ {
+ if(!blockColorStyle)
+ {
+ blockColorStyle = new BorderColor("border-y", "border-block-color");
+ styles.push(blockColorStyle);
+ }
+ blockColorStyle.value = value;
+ _blockColor = value;
+ }
+ private var _blockStartColor:String;
+ public function get blockStartColor():String
+ {
+ return _blockStartColor;
+ }
+ private var blockStartColorStyle:BorderColor;
+ public function set blockStartColor(value:String):void
+ {
+ if(!blockStartColorStyle)
+ {
+ blockStartColorStyle = new BorderColor("border-bs", "border-block-start-color");
+ styles.push(blockStartColorStyle);
+ }
+ blockStartColorStyle.value = value;
+ _blockStartColor = value;
+ }
+ private var _blockEndColor:String;
+ public function get blockEndColor():String
+ {
+ return _blockEndColor;
+ }
+ private var blockEndColorStyle:BorderColor;
+ public function set blockEndColor(value:String):void
+ {
+ if(!blockEndColorStyle)
+ {
+ blockEndColorStyle = new BorderColor("border-be", "border-block-end-color");
+ styles.push(blockEndColorStyle);
+ }
+ blockEndColorStyle.value = value;
+ _blockEndColor = value;
+ }
+ private var _inlineColor:String;
+ public function get inlineColor():String
+ {
+ return _inlineColor;
+ }
+ private var inlineColorStyle:BorderColor;
+ public function set inlineColor(value:String):void
+ {
+ if(!inlineColorStyle)
+ {
+ inlineColorStyle = new BorderColor("border-x", "border-inline-color");
+ styles.push(inlineColorStyle);
+ }
+ inlineColorStyle.value = value;
+ _inlineColor = value;
+ }
+ private var _inlineStartColor:String;
+ public function get inlineStartColor():String
+ {
+ return _inlineStartColor;
+ }
+ private var inlineStartColorStyle:BorderColor;
+ public function set inlineStartColor(value:String):void
+ {
+ if(!inlineStartColorStyle)
+ {
+ inlineStartColorStyle = new BorderColor("border-s", "border-inline-start-color");
+ styles.push(inlineStartColorStyle);
+ }
+ inlineStartColorStyle.value = value;
+ _inlineStartColor = value;
+ }
+ private var _inlineEndColor:String;
+ public function get inlineEndColor():String
+ {
+ return _inlineEndColor;
+ }
+ private var inlineEndColorStyle:BorderColor;
+ public function set inlineEndColor(value:String):void
+ {
+ if(!inlineEndColorStyle)
+ {
+ inlineEndColorStyle = new BorderColor("border-e", "border-inline-end-color");
+ styles.push(inlineEndColorStyle);
+ }
+ inlineEndColorStyle.value = value;
+ _inlineEndColor = value;
+ }
private var _style:String;
public function get style():String
@@ -72,6 +241,166 @@ package org.apache.royale.style.stylebeads.border
styleStyle.value = value;
_style = value;
}
+ private var _topStyle:String;
+ public function get topStyle():String
+ {
+ return _topStyle;
+ }
+ private var tStyle:BorderStyle;
+ public function set topStyle(value:String):void
+ {
+ if(!tStyle)
+ {
+ tStyle = new BorderStyle("border-t", "border-top-style");
+ styles.push(tStyle);
+ }
+ tStyle.value = value;
+ _topStyle = value;
+ }
+ private var _bottomStyle:String;
+ public function get bottomStyle():String
+ {
+ return _bottomStyle;
+ }
+ private var bStyle:BorderStyle;
+ public function set bottomStyle(value:String):void
+ {
+ if(!bStyle)
+ {
+ bStyle = new BorderStyle("border-b", "border-bottom-style");
+ styles.push(bStyle);
+ }
+ bStyle.value = value;
+ _bottomStyle = value;
+ }
+ private var _leftStyle:String;
+ public function get leftStyle():String
+ {
+ return _leftStyle;
+ }
+ private var lStyle:BorderStyle;
+ public function set leftStyle(value:String):void
+ {
+ if(!lStyle)
+ {
+ lStyle = new BorderStyle("border-l", "border-left-style");
+ styles.push(lStyle);
+ }
+ lStyle.value = value;
+ _leftStyle = value;
+ }
+ private var _rightStyle:String;
+ public function get rightStyle():String
+ {
+ return _rightStyle;
+ }
+ private var rStyle:BorderStyle;
+ public function set rightStyle(value:String):void
+ {
+ if(!rStyle)
+ {
+ rStyle = new BorderStyle("border-r", "border-right-style");
+ styles.push(rStyle);
+ }
+ rStyle.value = value;
+ _rightStyle = value;
+ }
+ private var _blockStyle:String;
+ public function get blockStyle():String
+ {
+ return _blockStyle;
+ }
+ private var blkStyle:BorderStyle;
+ public function set blockStyle(value:String):void
+ {
+ if(!blkStyle)
+ {
+ blkStyle = new BorderStyle("border-y", "border-block-style");
+ styles.push(blkStyle);
+ }
+ blkStyle.value = value;
+ _blockStyle = value;
+ }
+ private var _blockStartStyle:String;
+ public function get blockStartStyle():String
+ {
+ return _blockStartStyle;
+ }
+ private var blkStartStyle:BorderStyle;
+ public function set blockStartStyle(value:String):void
+ {
+ if(!blkStartStyle)
+ {
+ blkStartStyle = new BorderStyle("border-bs", "border-block-start-style");
+ styles.push(blkStartStyle);
+ }
+ blkStartStyle.value = value;
+ _blockStartStyle = value;
+ }
+ private var _blockEndStyle:String;
+ public function get blockEndStyle():String
+ {
+ return _blockEndStyle;
+ }
+ private var blkEndStyle:BorderStyle;
+ public function set blockEndStyle(value:String):void
+ {
+ if(!blkEndStyle)
+ {
+ blkEndStyle = new BorderStyle("border-be", "border-block-end-style");
+ styles.push(blkEndStyle);
+ }
+ blkEndStyle.value = value;
+ _blockEndStyle = value;
+ }
+ private var _inlineStyle:String;
+ public function get inlineStyle():String
+ {
+ return _inlineStyle;
+ }
+ private var inlStyle:BorderStyle;
+ public function set inlineStyle(value:String):void
+ {
+ if(!inlStyle)
+ {
+ inlStyle = new BorderStyle("border-x", "border-inline-style");
+ styles.push(inlStyle);
+ }
+ inlStyle.value = value;
+ _inlineStyle = value;
+ }
+ private var _inlineStartStyle:String;
+ public function get inlineStartStyle():String
+ {
+ return _inlineStartStyle;
+ }
+ private var inlStartStyle:BorderStyle;
+ public function set inlineStartStyle(value:String):void
+ {
+ if(!inlStartStyle)
+ {
+ inlStartStyle = new BorderStyle("border-s", "border-inline-start-style");
+ styles.push(inlStartStyle);
+ }
+ inlStartStyle.value = value;
+ _inlineStartStyle = value;
+ }
+ private var _inlineEndStyle:String;
+ public function get inlineEndStyle():String
+ {
+ return _inlineEndStyle;
+ }
+ private var inlEndStyle:BorderStyle;
+ public function set inlineEndStyle(value:String):void
+ {
+ if(!inlEndStyle)
+ {
+ inlEndStyle = new BorderStyle("border-e", "border-inline-end-style");
+ styles.push(inlEndStyle);
+ }
+ inlEndStyle.value = value;
+ _inlineEndStyle = value;
+ }
private var _width:*;
public function get width():*
@@ -84,11 +413,152 @@ package org.apache.royale.style.stylebeads.border
if(!widthStyle)
{
widthStyle = new BorderWidth();
+ widthStyle.unit = unit;
styles.push(widthStyle);
}
widthStyle.width = value;
_width = value;
}
+ public function get topWidth():*
+ {
+ return widthStyle ? widthStyle.top : null;
+ }
+ public function set topWidth(value:*):void
+ {
+ if(!widthStyle)
+ {
+ widthStyle = new BorderWidth();
+ widthStyle.unit = unit;
+ styles.push(widthStyle);
+ }
+ widthStyle.top = value;
+ }
+ public function get bottomWidth():*
+ {
+ return widthStyle ? widthStyle.bottom : null;
+ }
+ public function set bottomWidth(value:*):void
+ {
+ if(!widthStyle)
+ {
+ widthStyle = new BorderWidth();
+ widthStyle.unit = unit;
+ styles.push(widthStyle);
+ }
+ widthStyle.bottom = value;
+ }
+ public function get leftWidth():*
+ {
+ return widthStyle ? widthStyle.left : null;
+ }
+ public function set leftWidth(value:*):void
+ {
+ if(!widthStyle)
+ {
+ widthStyle = new BorderWidth();
+ widthStyle.unit = unit;
+ styles.push(widthStyle);
+ }
+ widthStyle.left = value;
+ }
+ public function get rightWidth():*
+ {
+ return widthStyle ? widthStyle.right : null;
+ }
+ public function set rightWidth(value:*):void
+ {
+ if(!widthStyle)
+ {
+ widthStyle = new BorderWidth();
+ widthStyle.unit = unit;
+ styles.push(widthStyle);
+ }
+ widthStyle.right = value;
+ }
+ public function get blockWidth():*
+ {
+ return widthStyle ? widthStyle.block : null;
+ }
+ public function set blockWidth(value:*):void
+ {
+ if(!widthStyle)
+ {
+ widthStyle = new BorderWidth();
+ widthStyle.unit = unit;
+ styles.push(widthStyle);
+ }
+ widthStyle.block = value;
+ }
+ public function get blockStartWidth():*
+ {
+ return widthStyle ? widthStyle.blockStart : null;
+ }
+ public function set blockStartWidth(value:*):void
+ {
+ if(!widthStyle)
+ {
+ widthStyle = new BorderWidth();
+ widthStyle.unit = unit;
+ styles.push(widthStyle);
+ }
+ widthStyle.blockStart = value;
+ }
+ public function get blockEndWidth():*
+ {
+ return widthStyle ? widthStyle.blockEnd : null;
+ }
+ public function set blockEndWidth(value:*):void
+ {
+ if(!widthStyle)
+ {
+ widthStyle = new BorderWidth();
+ widthStyle.unit = unit;
+ styles.push(widthStyle);
+ }
+ widthStyle.blockEnd = value;
+ }
+ public function get inlineWidth():*
+ {
+ return widthStyle ? widthStyle.inline : null;
+ }
+ public function set inlineWidth(value:*):void
+ {
+ if(!widthStyle)
+ {
+ widthStyle = new BorderWidth();
+ widthStyle.unit = unit;
+ styles.push(widthStyle);
+ }
+ widthStyle.inline = value;
+ }
+ public function get inlineStartWidth():*
+ {
+ return widthStyle ? widthStyle.inlineStart : null;
+ }
+ public function set inlineStartWidth(value:*):void
+ {
+ if(!widthStyle)
+ {
+ widthStyle = new BorderWidth();
+ widthStyle.unit = unit;
+ styles.push(widthStyle);
+ }
+ widthStyle.inlineStart = value;
+ }
+ public function get inlineEndWidth():*
+ {
+ return widthStyle ? widthStyle.inlineEnd : null;
+ }
+ public function set inlineEndWidth(value:*):void
+ {
+ if(!widthStyle)
+ {
+ widthStyle = new BorderWidth();
+ widthStyle.unit = unit;
+ styles.push(widthStyle);
+ }
+ widthStyle.inlineEnd = value;
+ }
private var _radius:*;
public function get radius():*
@@ -101,28 +571,123 @@ package org.apache.royale.style.stylebeads.border
if(!radiusStyle)
{
radiusStyle = new BorderRadius();
+ radiusStyle.unit = unit;
styles.push(radiusStyle);
}
radiusStyle.radius = value;
_radius = value;
}
- }
-}
-import org.apache.royale.style.stylebeads.LeafStyleBase;
-import org.apache.royale.style.util.StyleData;
-import org.apache.royale.debugging.assert;
-
-class Color extends LeafStyleBase
-{
- public function Color(value:* = null)
- {
- super("border", "border-color", value);
- }
- override public function set value(value:*):void
- {
- _value = value;
- var styleData:StyleData = validateColor(value,false);
- calculatedSelector = styleData.selector;
- calculatedRuleValue = styleData.rule;
+ public function get topLeftRadius():*
+ {
+ return radiusStyle ? radiusStyle.topLeft : null;
+ }
+ public function set topLeftRadius(value:*):void
+ {
+ if(!radiusStyle)
+ {
+ radiusStyle = new BorderRadius();
+ radiusStyle.unit = unit;
+ styles.push(radiusStyle);
+ }
+ radiusStyle.topLeft = value;
+ }
+ public function get topRightRadius():*
+ {
+ return radiusStyle ? radiusStyle.topRight : null;
+ }
+ public function set topRightRadius(value:*):void
+ {
+ if(!radiusStyle)
+ {
+ radiusStyle = new BorderRadius();
+ radiusStyle.unit = unit;
+ styles.push(radiusStyle);
+ }
+ radiusStyle.topRight = value;
+ }
+ public function get bottomLeftRadius():*
+ {
+ return radiusStyle ? radiusStyle.bottomLeft : null;
+ }
+ public function set bottomLeftRadius(value:*):void
+ {
+ if(!radiusStyle)
+ {
+ radiusStyle = new BorderRadius();
+ radiusStyle.unit = unit;
+ styles.push(radiusStyle);
+ }
+ radiusStyle.bottomLeft = value;
+ }
+ public function get bottomRightRadius():*
+ {
+ return radiusStyle ? radiusStyle.bottomRight : null;
+ }
+ public function set bottomRightRadius(value:*):void
+ {
+ if(!radiusStyle)
+ {
+ radiusStyle = new BorderRadius();
+ radiusStyle.unit = unit;
+ styles.push(radiusStyle);
+ }
+ radiusStyle.bottomRight = value;
+ }
+ public function get startStartRadius():*
+ {
+ return radiusStyle ? radiusStyle.startStart : null;
+ }
+ public function set startStartRadius(value:*):void
+ {
+ if(!radiusStyle)
+ {
+ radiusStyle = new BorderRadius();
+ radiusStyle.unit = unit;
+ styles.push(radiusStyle);
+ }
+ radiusStyle.startStart = value;
+ }
+ public function get startEndRadius():*
+ {
+ return radiusStyle ? radiusStyle.startEnd : null;
+ }
+ public function set startEndRadius(value:*):void
+ {
+ if(!radiusStyle)
+ {
+ radiusStyle = new BorderRadius();
+ radiusStyle.unit = unit;
+ styles.push(radiusStyle);
+ }
+ radiusStyle.startEnd = value;
+ }
+ public function get endStartRadius():*
+ {
+ return radiusStyle ? radiusStyle.endStart : null;
+ }
+ public function set endStartRadius(value:*):void
+ {
+ if(!radiusStyle)
+ {
+ radiusStyle = new BorderRadius();
+ radiusStyle.unit = unit;
+ styles.push(radiusStyle);
+ }
+ radiusStyle.endStart = value;
+ }
+ public function get endEndRadius():*
+ {
+ return radiusStyle ? radiusStyle.endEnd : null;
+ }
+ public function set endEndRadius(value:*):void
+ {
+ if(!radiusStyle)
+ {
+ radiusStyle = new BorderRadius();
+ radiusStyle.unit = unit;
+ styles.push(radiusStyle);
+ }
+ radiusStyle.endEnd = value;
+ }
}
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderColor.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderColor.as
index efca63a428..07a1d14820 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderColor.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderColor.as
@@ -23,9 +23,14 @@ package org.apache.royale.style.stylebeads.border
public class BorderColor extends LeafStyleBase
{
- public function BorderColor(value:* = null)
+ public function BorderColor(selectorBase:* = "border", ruleBase:String = "border-color", value:* = null)
{
- super("border", "border-color", value);
+ if (!(selectorBase is String))
+ {
+ value = selectorBase;
+ selectorBase = "border";
+ }
+ super(selectorBase as String, ruleBase, value);
}
override public function set value(value:*):void
{
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderRadius.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderRadius.as
index c07dcd86cb..3533cec1c4 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderRadius.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderRadius.as
@@ -28,10 +28,11 @@ package org.apache.royale.style.stylebeads.border
*/
public class BorderRadius extends CompositeStyle
{
- public function BorderRadius(value:* = null)
+ public function BorderRadius(value:* = null, unit:String = "px")
{
super();
styles = [];
+ this.unit = unit;
//because of @royalesuppressexport, the following did not work in release/minified build from within this constructor when using the radius setter directly:
//if (value) radius = value;
//however a usage of the getter here will make the setter usage survive minification:
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderStyle.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderStyle.as
index 5d3ab7b3b9..556d6531cd 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderStyle.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderStyle.as
@@ -23,15 +23,26 @@ package org.apache.royale.style.stylebeads.border
public class BorderStyle extends LeafStyleBase
{
- public function BorderStyle(value:* = null)
+ public function BorderStyle(selectorBase:String = "border", ruleBase:String = "border-style", value:* = null)
{
- super("border", "border-style", value);
+ super(selectorBase, ruleBase, value);
}
[Inspectable(category="General", enumeration="solid,dashed,dotted,double,hidden,none", defaultValue="solid")]
override public function set value(value:*):void
{
- assert(["solid", "dashed", "dotted", "double", "hidden", "none"].indexOf(value) >= 0, "The value must be a valid border style: " + value);
- calculatedSelector = calculatedRuleValue = _value = value;
+ _value = value;
+ calculatedSelector = value;
+ calculatedRuleValue = value;
+ }
+
+ override public function getRule():String
+ {
+ // enable outline in forced colors mode
+ if(calculatedSelector == "hidden")
+ {
+ return ruleBase + ": 2px solid transparent; " + ruleBase + "-offset: 2px;";
+ }
+ return super.getRule();
}
}
}
\ No newline at end of file
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderWidth.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderWidth.as
index 7e17dcc06e..fa176d9c4f 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderWidth.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderWidth.as
@@ -28,10 +28,11 @@ package org.apache.royale.style.stylebeads.border
*/
public class BorderWidth extends CompositeStyle
{
- public function BorderWidth(value:* = null)
+ public function BorderWidth(value:* = null, unit:String = "px")
{
super();
styles = [];
+ this.unit = unit;
if(value)
this.width = value;
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/Outline.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/Outline.as
index c1b797a0e0..d98d0e0303 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/Outline.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/Outline.as
@@ -38,12 +38,12 @@ package org.apache.royale.style.stylebeads.border
{
return _color;
}
- private var colorStyle:Color;
+ private var colorStyle:BorderColor;
public function set color(value:String):void
{
if(!colorStyle)
{
- colorStyle = new Color();
+ colorStyle = new BorderColor("outline", "outline-color");
styles.push(colorStyle);
}
colorStyle.value = value;
@@ -70,7 +70,7 @@ package org.apache.royale.style.stylebeads.border
{
return _style;
}
- private var styleStyle:Style;
+ private var styleStyle:BorderStyle;
public function set style(value:String):void
{
if(!styleStyle)
@@ -99,27 +99,11 @@ package org.apache.royale.style.stylebeads.border
}
}
}
+
import org.apache.royale.style.stylebeads.LeafStyleBase;
-import org.apache.royale.style.util.StyleData;
import org.apache.royale.debugging.assert;
+import org.apache.royale.style.stylebeads.border.BorderStyle;
-class Color extends LeafStyleBase
-{
- public function Color(value:* = null)
- {
- super("outline", "outline-color", value);
- }
- /**
- * @royaleignorecoercion org.apache.royale.style.colors.ColorPair
- */
- override public function set value(value:*):void
- {
- _value = value;
- var styleData:StyleData = validateColor(value,false);
- calculatedRuleValue = styleData.rule;
- calculatedSelector = styleData.selector;
- }
-}
class Offset extends LeafStyleBase
{
public function Offset(value:* = null)
@@ -129,7 +113,8 @@ class Offset extends LeafStyleBase
private var savedPrefix:String;
override public function set value(value:*):void
{
- var numVal:Number = parseFloat(value);
+ var val:* = value;
+ var numVal:Number = parseFloat(val);
var negative:Boolean = numVal < 0;
if(!savedPrefix)
savedPrefix = selectorBase;
@@ -146,17 +131,12 @@ class Offset extends LeafStyleBase
calculatedSelector = sanitizeSelector(value);
}
}
-class Style extends LeafStyleBase
+class Style extends BorderStyle
{
public function Style(value:* = null)
{
super("outline", "outline-style", value);
}
- override public function set value(value:*):void
- {
- assert(["solid","dashed","dotted","double","hidden","none"].indexOf(value) >= 0, "The value must be a valid outline style: " + value);
- calculatedSelector = calculatedRuleValue = _value = value;
- }
override public function getRule():String
{
// enable outline in in forced colors mode
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/flexgrid/Flex.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/flexgrid/Flex.as
index b29b230d38..10754a3561 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/flexgrid/Flex.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/flexgrid/Flex.as
@@ -31,7 +31,7 @@ package org.apache.royale.style.stylebeads.flexgrid
{
COMPILE::JS
{
- value = value.trim();
+ value = (''+value).trim(); //String conversion first in case it got passed as a number
// TODO validate aspect before setting
calculatedRuleValue = calculatedSelector = _value = value;
var isNum:Boolean = parseFloat(value) == value;
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/flexgrid/FlexBasis.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/flexgrid/FlexBasis.as
index b958ecd339..0f5c4d3c02 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/flexgrid/FlexBasis.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/flexgrid/FlexBasis.as
@@ -29,9 +29,16 @@ package org.apache.royale.style.stylebeads.flexgrid
override public function set value(value:*):void
{
+ if(value === 0 || value === "0") {
+ _value = value;
+ calculatedRuleValue = calculatedSelector = "0";
+ return;
+ }
+ _value = value;
+ calculatedRuleValue = calculatedSelector = value;
// TODO validate aspect before setting
var isNum:Boolean = parseFloat(value) == value;
- var isInt:Boolean = int(value) == value;
+ var isInt:Boolean = parseInt(value) == value;
if(isNum && !isInt)
calculatedRuleValue = (value * 100) + "%";
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderColor.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/layout/Content.as
similarity index 71%
copy from frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderColor.as
copy to frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/layout/Content.as
index efca63a428..1a3597664f 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/BorderColor.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/layout/Content.as
@@ -16,23 +16,25 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.royale.style.stylebeads.border
+package org.apache.royale.style.stylebeads.layout
{
import org.apache.royale.style.stylebeads.LeafStyleBase;
- import org.apache.royale.style.util.StyleData;
- public class BorderColor extends LeafStyleBase
+ public class Content extends LeafStyleBase
{
- public function BorderColor(value:* = null)
+ /**
+ * for use inside BeforeState and AfterState declarations (for completeness)
+ * @param value
+ */
+ public function Content(value:* = '""')
{
- super("border", "border-color", value);
+ super("", "content", value);
}
- override public function set value(value:*):void
+
+ public function set value(value:*):void
{
_value = value;
- var styleData:StyleData = validateColor(value, false);
- calculatedSelector = styleData.selector;
- calculatedRuleValue = styleData.rule;
+ calculatedRuleValue = calculatedSelector = value;
}
}
-}
\ No newline at end of file
+}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/spacing/Margin.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/spacing/Margin.as
index 3f2c852583..764a50bec7 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/spacing/Margin.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/spacing/Margin.as
@@ -25,11 +25,13 @@ package org.apache.royale.style.stylebeads.spacing
*/
public class Margin extends CompositeStyle
{
- public function Margin(value:* = null)
+ public function Margin(value:* = null, unit:String = "px")
{
super();
styles = [];
- unit = "px";
+ this.unit = unit;
+ if(value != null)
+ this.margin = value;
}
private var marginStyle:Marg;
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/spacing/Padding.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/spacing/Padding.as
index bd2b82ace4..0a08d860c4 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/spacing/Padding.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/spacing/Padding.as
@@ -25,11 +25,11 @@ package org.apache.royale.style.stylebeads.spacing
*/
public class Padding extends CompositeStyle
{
- public function Padding(value:* = null)
+ public function Padding(value:* = null, unit:String = "px")
{
super();
styles = [];
- unit = "px";
+ this.unit = unit;
if(value != null)
this.padding = value;
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/ActiveState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/ActiveState.as
index 092dfe9abc..79a67641a5 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/ActiveState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/ActiveState.as
@@ -20,9 +20,9 @@ package org.apache.royale.style.stylebeads.states
{
public class ActiveState extends LeafDecorator
{
- public function ActiveState()
+ public function ActiveState(styles:Array = null)
{
- super();
+ super(styles);
selectorDecorator = "active:";
ruleDecorator = ":active";
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/FocusState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/FocusState.as
index 33bb96d548..e4087cd80a 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/FocusState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/FocusState.as
@@ -20,9 +20,9 @@ package org.apache.royale.style.stylebeads.states
{
public class FocusState extends LeafDecorator
{
- public function FocusState()
+ public function FocusState(styles:Array = null)
{
- super();
+ super(styles);
selectorDecorator = "focus:";
ruleDecorator = ":focus";
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/RequiredState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/RequiredState.as
index 0fc43498c9..f3ab76070e 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/RequiredState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/RequiredState.as
@@ -20,9 +20,9 @@ package org.apache.royale.style.stylebeads.states
{
public class RequiredState extends LeafDecorator
{
- public function RequiredState()
+ public function RequiredState(styles:Array = null)
{
- super();
+ super(styles);
selectorDecorator = "required:";
ruleDecorator = ":required";
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/AriaState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/AriaState.as
index b81186382a..24bc91bf53 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/AriaState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/AriaState.as
@@ -25,9 +25,9 @@ package org.apache.royale.style.stylebeads.states.attribute
public class AriaState extends LeafDecorator
{
- public function AriaState()
+ public function AriaState(styles:Array = null)
{
- super();
+ super(styles);
}
private var _aria:String;
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/InertState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/InertState.as
index 70dd27cee1..27ebc03f5d 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/InertState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/InertState.as
@@ -25,9 +25,9 @@ package org.apache.royale.style.stylebeads.states.attribute
public class InertState extends LeafDecorator
{
- public function InertState()
+ public function InertState(styles:Array = null)
{
- super();
+ super(styles);
selectorDecorator = "inert:";
ruleDecorator = ":is([inert], [inert] *)";
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/OpenState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/OpenState.as
index 93581e880a..3a67cc4207 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/OpenState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/OpenState.as
@@ -24,9 +24,9 @@ package org.apache.royale.style.stylebeads.states.attribute
public class OpenState extends LeafDecorator
{
- public function OpenState()
+ public function OpenState(styles:Array = null)
{
- super();
+ super(styles);
selectorDecorator = "open:";
ruleDecorator = ":is([open], :popover-open, :open)";
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/RTLState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/RTLState.as
index a6cd6cad6b..d389c46df9 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/RTLState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/attribute/RTLState.as
@@ -24,9 +24,9 @@ package org.apache.royale.style.stylebeads.states.attribute
public class RTLState extends LeafDecorator
{
- public function RTLState()
+ public function RTLState(styles:Array = null)
{
- super();
+ super(styles);
selectorDecorator = "rtl:";
ruleDecorator = ":where(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),[dir=rtl],[dir=rtl] *)";
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/AfterState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/AfterState.as
index 9e4255a769..c1b8ca3d29 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/AfterState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/AfterState.as
@@ -25,9 +25,9 @@ package org.apache.royale.style.stylebeads.states.pseudo
*/
public class AfterState extends LeafDecorator
{
- public function AfterState()
+ public function AfterState(styles:Array = null)
{
- super();
+ super(styles);
selectorDecorator = "after:";
ruleDecorator = "::after";
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/BackdropState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/BackdropState.as
index b66471231b..b66789ee82 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/BackdropState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/BackdropState.as
@@ -22,9 +22,9 @@ package org.apache.royale.style.stylebeads.states.pseudo
public class BackdropState extends LeafDecorator
{
- public function BackdropState()
+ public function BackdropState(styles:Array = null)
{
- super();
+ super(styles);
selectorDecorator = "backdrop:";
ruleDecorator = "::backdrop";
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/BeforeState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/BeforeState.as
index 79ede71409..b90ed74b4e 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/BeforeState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/BeforeState.as
@@ -25,9 +25,9 @@ package org.apache.royale.style.stylebeads.states.pseudo
*/
public class BeforeState extends LeafDecorator
{
- public function BeforeState()
+ public function BeforeState(styles:Array = null)
{
- super();
+ super(styles);
selectorDecorator = "before:";
ruleDecorator = "::before";
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/FileState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/FileState.as
index ec87fcb576..e2e6aee162 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/FileState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/FileState.as
@@ -22,9 +22,9 @@ package org.apache.royale.style.stylebeads.states.pseudo
public class FileState extends LeafDecorator
{
- public function FileState()
+ public function FileState(styles:Array = null)
{
- super();
+ super(styles);
selectorDecorator = "file:";
ruleDecorator = "::file-selector-button";
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/FirstLetterState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/FirstLetterState.as
index af4516bc96..1f945cacd8 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/FirstLetterState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/FirstLetterState.as
@@ -22,11 +22,11 @@ package org.apache.royale.style.stylebeads.states.pseudo
public class FirstLetterState extends LeafDecorator
{
- public function FirstLetterState()
+ public function FirstLetterState(styles:Array = null)
{
- super();
+ super(styles);
selectorDecorator = "first-letter:";
- ruleDecorator = ":first-letter";
+ ruleDecorator = "::first-letter";
}
}
}
\ No newline at end of file
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/FirstLineState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/FirstLineState.as
index 9358f29c09..2932e130cc 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/FirstLineState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/FirstLineState.as
@@ -22,11 +22,11 @@ package org.apache.royale.style.stylebeads.states.pseudo
public class FirstLineState extends LeafDecorator
{
- public function FirstLineState()
+ public function FirstLineState(styles:Array = null)
{
- super();
+ super(styles);
selectorDecorator = "first-line:";
- ruleDecorator = ":first-line";
+ ruleDecorator = "::first-line";
}
}
}
\ No newline at end of file
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/MarkerState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/MarkerState.as
index 1a7b5f8572..edcaa5d2e4 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/MarkerState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/MarkerState.as
@@ -22,9 +22,9 @@ package org.apache.royale.style.stylebeads.states.pseudo
public class MarkerState extends LeafDecorator
{
- public function MarkerState()
+ public function MarkerState(styles:Array = null)
{
- super();
+ super(styles);
selectorDecorator = "marker:";
ruleDecorator = "::marker";
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/PlaceholderState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/PlaceholderState.as
index d256a6576c..70484868f7 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/PlaceholderState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/PlaceholderState.as
@@ -22,9 +22,9 @@ package org.apache.royale.style.stylebeads.states.pseudo
public class PlaceholderState extends LeafDecorator
{
- public function PlaceholderState()
+ public function PlaceholderState(styles:Array = null)
{
- super();
+ super(styles);
selectorDecorator = "placeholder:";
ruleDecorator = "::placeholder";
}
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/SelectionState.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/SelectionState.as
index 83ed022246..29d48efe75 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/SelectionState.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/pseudo/SelectionState.as
@@ -22,9 +22,9 @@ package org.apache.royale.style.stylebeads.states.pseudo
public class SelectionState extends LeafDecorator
{
- public function SelectionState()
+ public function SelectionState(styles:Array = null)
{
- super();
+ super(styles);
selectorDecorator = "selection:";
ruleDecorator = "::selection";
}
(royale-asjs) 04/05: unit propagation.
Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 473d7df2b4c63b7a6279be408adf6c290971d0d7
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Apr 1 20:08:22 2026 +1300
unit propagation.
---
.../org/apache/royale/style/stylebeads/StyleBeadBase.as | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/StyleBeadBase.as b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/StyleBeadBase.as
index 1bbe48762f..53d97140d3 100644
--- a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/StyleBeadBase.as
+++ b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/StyleBeadBase.as
@@ -76,6 +76,9 @@ package org.apache.royale.style.stylebeads
style.parentStyle = parentStyle;
if(style is ILeafStyleBead)
(style as ILeafStyleBead).unit = unit;
+ else if (style is StyleBeadBase)
+ (style as StyleBeadBase).unit = unit;
+
if(style.isLeaf)
{
retVal.push(style);
@@ -131,6 +134,16 @@ package org.apache.royale.style.stylebeads
public function set unit(value:String):void
{
_unit = value;
+ if (styles)
+ {
+ for each(var style:IStyleBead in styles)
+ {
+ if(style is ILeafStyleBead)
+ (style as ILeafStyleBead).unit = value;
+ else if (style is StyleBeadBase)
+ (style as StyleBeadBase).unit = value;
+ }
+ }
}
public function decorateChildStyle(style:ILeafStyleBead, decorations:Array):void
{