This is an automated email from the ASF dual-hosted git repository.
greg-dove 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 1dce3d897d add flavor to Divider
1dce3d897d is described below
commit 1dce3d897d4e8164ec2be436721b710cb2590bad
Author: greg-dove <[email protected]>
AuthorDate: Tue May 5 16:36:24 2026 +1200
add flavor to Divider
---
.../main/royale/org/apache/royale/style/Divider.as | 44 +++++++++++++++++++++-
.../org/apache/royale/style/skins/DividerSkin.as | 13 +++++--
2 files changed, 51 insertions(+), 6 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 2cd69f941a..e1b818d77c 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
@@ -86,7 +86,9 @@ package org.apache.royale.style
public function set edgePadding(value:Number):void{
if (_edgePadding != value) {
_edgePadding = value;
- if (skin) skin.update();
+ if (skin) {
+ skin.update();
+ }
}
}
@@ -106,7 +108,45 @@ package org.apache.royale.style
_vertical = value;
if (skin) skin.update();
}
-
+ }
+
+ private var _flavor:String = 'default';
+ public function get flavor():String
+ {
+ return _flavor;
+ }
+
+ [Inspectable(category="General",
enumeration="base,primary,secondary,accent,info,success,warning,error,neutral",
defaultValue="default")]
+ /**
+ * Set the flavor of the Toast
+ * One of info, success, positive and negative. warning also
appears to be an option
+ * To set the Toast to the default, specify an empty string
+ */
+ public function set flavor(value:String):void
+ {
+ if (!value) value = 'default';
+ if(value != _flavor){
+ switch(value){
+ case "default":
+ case 'base':
+ case 'primary':
+ case 'secondary':
+ case 'accent':
+ case 'info':
+ case 'success':
+ case 'warning':
+ case 'error':
+ case 'neutral':
+ break;
+ default:
+ throw new Error("Unknown
flavor: " + value);
+ }
+ _flavor = value;
+ if (skin) {
+ skin.update();
+ applySkin()
+ }
+ }
}
}
}
\ No newline at end of file
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 f400b9dfdd..34d67729c8 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
@@ -20,6 +20,7 @@ package org.apache.royale.style.skins
{
import org.apache.royale.style.StyleSkin;
import org.apache.royale.core.IStrand;
+ import org.apache.royale.style.colors.ThemeColorSet;
import org.apache.royale.style.stylebeads.background.BackgroundClip;
import org.apache.royale.style.stylebeads.border.Border;
import org.apache.royale.style.stylebeads.sizing.HeightStyle;
@@ -64,7 +65,7 @@ package org.apache.royale.style.skins
}
override public function update():void{
- processStyles()
+ processStyles();
}
private var _lineStyles:Array;
@@ -86,8 +87,12 @@ package org.apache.royale.style.skins
var appliedSize:String = computeSize(size, hostUnit);
+ var hostColor:String = host.flavor;
+ if (hostColor == 'default') hostColor = 'base';
+ const colorSet:ThemeColorSet =
ThemeManager.instance.activeTheme.themeColorSet;
+ hostColor = colorSet.getThemeBaseColor(hostColor);
+
var hostStyles:Array = [
- // new BackgroundColor('transparent'), //probably
not needed
new Display('flex'),
new Flex(0),
new JustifyContent('center'),
@@ -95,7 +100,7 @@ package org.apache.royale.style.skins
];
var lineStylesArr:Array = [
- new BackgroundColor("slate-"+colorAdjust),
+ new BackgroundColor(hostColor+"-"+colorAdjust),
new
BorderRadius(ThemeManager.instance.activeTheme.radiusSM)
];
@@ -149,7 +154,7 @@ package org.apache.royale.style.skins
return 700;
case "md":
default:
- return 900;
+ return 400;
}
}