drawer event chain complete

This commit is contained in:
2025-11-19 22:13:11 +01:00
parent a6e2e7aa58
commit d27fe111b9
7 changed files with 49 additions and 41 deletions
+8 -15
View File
@@ -1,5 +1,6 @@
package components;
import model.Constants;
import feathers.events.TriggerEvent;
import feathers.controls.Button;
import feathers.layout.VerticalLayout;
@@ -10,6 +11,9 @@ import feathers.controls.Drawer;
class NekoDrawer extends Drawer {
public static final CLOSE:String = "close";
public static final OPEN:String = "open";
private var openDrawerButton:Button;
private var closeDrawerButton:Button;
private var coucou:Bool;
@@ -22,24 +26,11 @@ class NekoDrawer extends Drawer {
override private function initialize():Void {
super.initialize();
var c1 = new LayoutGroup();
var contentLayout = new VerticalLayout();
contentLayout.horizontalAlign = CENTER;
contentLayout.verticalAlign = MIDDLE;
c1.layout = contentLayout;
openDrawerButton = new Button();
openDrawerButton.text = "Open Drawer";
openDrawerButton.addEventListener(TriggerEvent.TRIGGER, (event) -> {
opened = true;
});
c1.addChild(openDrawerButton);
content = c1;
var d1 = new LayoutGroup();
var drawerLayout = new VerticalLayout();
drawerLayout.setPadding(10);
drawerLayout.horizontalAlign = CENTER;
drawerLayout.verticalAlign = MIDDLE;
drawerLayout.verticalAlign = TOP;
d1.layout = drawerLayout;
closeDrawerButton = new Button();
closeDrawerButton.text = "Close Drawer";
@@ -48,6 +39,8 @@ class NekoDrawer extends Drawer {
});
d1.addChild(closeDrawerButton);
overlaySkin = new NekoRectangle(Constants.HERO_COLOR);
drawer = d1;
}