Skip to content

Commit 66c33b0

Browse files
committed
has-label / has-icon
1 parent 422ddfd commit 66c33b0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

haxe/ui/components/Button.hx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,12 +538,14 @@ private class TextBehaviour extends DataBehaviour {
538538
var label:Label = _component.findComponent(Label, false);
539539
if (_value == null || _value.isNull) {
540540
if (label != null) {
541+
_component.removeClass("has-label", false);
541542
_component.removeComponent(label);
542543
}
543544
} else {
544545
if (label == null) {
545546
label = new Label();
546547
label.id = "button-label";
548+
_component.addClass("has-label", false);
547549
_component.addComponent(label);
548550
_component.invalidateComponentStyle(true);
549551
}
@@ -560,6 +562,7 @@ private class IconBehaviour extends DataBehaviour {
560562

561563
if ((_value == null || _value.isNull || _value == "") && icon != null) {
562564
_component.customStyle.icon = null;
565+
_component.removeClass("has-icon", false);
563566
_component.removeComponent(icon);
564567
return;
565568
}
@@ -574,6 +577,7 @@ private class IconBehaviour extends DataBehaviour {
574577
icon.addClass(":down");
575578
}
576579
icon.id = "button-icon";
580+
_component.addClass("has-icon", false);
577581
_component.addComponentAt(icon, 0);
578582
_component.invalidateComponentStyle(true);
579583
}

0 commit comments

Comments
 (0)