From fd5eaac4c64ed37d1a822c2f19e63c0fecdf83cf Mon Sep 17 00:00:00 2001 From: nekotoro Date: Mon, 24 Nov 2025 22:11:07 +0100 Subject: [PATCH] Added an AnchorLayout to the MainPanel and set the layout data poroperty of the StackNavigator to AnchorLayoutData.fill() --- src/view/MainHeader.hx | 4 ++-- src/view/MainPanel.hx | 13 +++++++++---- src/view/RidersScreen.hx | 21 ++++++++++++--------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/view/MainHeader.hx b/src/view/MainHeader.hx index fa5737d..9bc914e 100644 --- a/src/view/MainHeader.hx +++ b/src/view/MainHeader.hx @@ -49,7 +49,7 @@ class MainHeader extends LayoutGroup { var l:HorizontalLayout = new HorizontalLayout(); l.paddingLeft = l.paddingRight = Std.int(headerHeight * .1); l.paddingTop = l.paddingBottom = Std.int(headerHeight * .1); - //l.verticalAlign = MIDDLE; + l.verticalAlign = MIDDLE; layout = l; } @@ -67,7 +67,7 @@ class MainHeader extends LayoutGroup { lbl1.text = Constants.MENU_ITEM_0_STRING; lbl1.embedFonts = true; var fnt:Font = Assets.getFont(Constants.MONTSERRAT_MEDIUM_500); - lbl1.textFormat = new TextFormat(fnt.fontName, Std.int(headerHeight * .4), Constants.MAIN_COLOR3); + lbl1.textFormat = new TextFormat(fnt.fontName, Std.int(headerHeight * .3), Constants.MAIN_COLOR3); addChild(lbl1); } diff --git a/src/view/MainPanel.hx b/src/view/MainPanel.hx index 3c6ac53..360cbd7 100644 --- a/src/view/MainPanel.hx +++ b/src/view/MainPanel.hx @@ -1,5 +1,7 @@ package view; +import feathers.layout.AnchorLayoutData; +import feathers.layout.AnchorLayout; import feathers.controls.navigators.StackItem; import feathers.controls.navigators.StackNavigator; import feathers.controls.Button; @@ -28,10 +30,7 @@ class MainPanel extends Panel { autoSizeMode = STAGE; backgroundSkin = new RectangleSkin(SolidColor(Constants.MAIN_COLOR2, 1)); - } - - private function onCreationComplete(event:FeathersEvent):Void { - traceBlue(this + " --> onCreationComplete() - w: " + width + " h: " + height ); + layout = new AnchorLayout(); mh = new MainHeader(); header = mh; @@ -41,8 +40,14 @@ class MainPanel extends Panel { sn = new StackNavigator(); sn.autoSizeMode = STAGE; + sn.layoutData = AnchorLayoutData.fill(); sn.addItem(StackItem.withClass("ridersScreen", RidersScreen)); sn.rootItemID = "ridersScreen"; addChild(sn); + + } + + private function onCreationComplete(event:FeathersEvent):Void { + traceBlue(this + " --> onCreationComplete() - w: " + width + " h: " + height ); } } \ No newline at end of file diff --git a/src/view/RidersScreen.hx b/src/view/RidersScreen.hx index 7e6e68a..de1188a 100644 --- a/src/view/RidersScreen.hx +++ b/src/view/RidersScreen.hx @@ -1,5 +1,7 @@ package view; +import feathers.layout.AnchorLayoutData; +import feathers.layout.AnchorLayout; import feathers.events.FeathersEvent; import feathers.layout.VerticalLayout; import feathers.controls.ScrollContainer; @@ -18,19 +20,20 @@ class RidersScreen extends ScrollContainer { override private function initialize():Void { super.initialize(); - var vl:VerticalLayout = new VerticalLayout(); - vl.verticalAlign = TOP; - layout = vl; + layout = new AnchorLayout(); + + tb = new ToolBar(); + tb.layoutData = AnchorLayoutData.fillHorizontal(); + addChild(tb); + + rl = new RidersList(); + rl.layoutData = AnchorLayoutData.fillHorizontal(); + rl.y = 80; + addChild(rl); } private function onCreationComplete(event:FeathersEvent):Void { traceBlue(this + " --> onCreationComplete() - w: " + width + " h: " + height ); - - tb = new ToolBar(); - addChild(tb); - - rl = new RidersList(); - addChild(rl); } }