From cb5b2166ad38454b8d3c4db562b6336dc4937f65 Mon Sep 17 00:00:00 2001 From: Ian Harrigan Date: Thu, 31 Aug 2023 21:36:13 +0200 Subject: [PATCH] assign position classes when showing hiding buttons --- haxe/ui/containers/ButtonBar.hx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/haxe/ui/containers/ButtonBar.hx b/haxe/ui/containers/ButtonBar.hx index 213dcedf5..81ee37809 100644 --- a/haxe/ui/containers/ButtonBar.hx +++ b/haxe/ui/containers/ButtonBar.hx @@ -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); }