Skip to content

Commit

Permalink
assign position classes when showing hiding buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Aug 31, 2023
1 parent 25dda8c commit cb5b216
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions haxe/ui/containers/ButtonBar.hx
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,21 @@ class ButtonBarBuilder extends CompositeBuilder {
public override function addComponent(child:Component):Component {
if ((child is Button)) {
cast(child, Button).toggle = _bar.toggle;
child.registerEvent(UIEvent.SHOWN, onButtonShown);
child.registerEvent(UIEvent.HIDDEN, onButtonHidden);
}

return null;
}

private function onButtonShown(_) {
_bar.assignPositionClasses();
}

private function onButtonHidden(_) {
_bar.assignPositionClasses();
}

public override function onComponentAdded(child:Component) {
_component.registerInternalEvents(true);
}
Expand Down

0 comments on commit cb5b216

Please sign in to comment.