Skip to content

Commit

Permalink
allow decorators apply icons from css
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Nov 11, 2023
1 parent 76401f9 commit 01aebb1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion haxe/ui/components/Decorator.hx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package haxe.ui.components;

import haxe.ui.util.Variant;
import haxe.ui.containers.Box;
import haxe.ui.styles.Style;
import haxe.ui.util.Variant;

// TODO: move to behaviours (not really priority as it will probably never have a native counterpart)
class Decorator extends Box {
Expand All @@ -14,4 +15,12 @@ class Decorator extends Box {
image.resource = value;
return value;
}

public override function applyStyle(style:Style) {
super.applyStyle(style);

if (style.icon != null) {
this.icon = style.icon;
}
}
}

0 comments on commit 01aebb1

Please sign in to comment.