Skip to content

Commit

Permalink
better autosize calc for tabPosition=bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Sep 27, 2024
1 parent d294438 commit 4d3973d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions haxe/ui/containers/TabView.hx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,24 @@ private class Layout extends DefaultLayout {
}
return size;
}

public override function calcAutoSize(exclusions:Array<Component> = null):Size {
var tabs:TabBar = component.findComponent(TabBar, false);
var content:Box = component.findComponent(Box, false);
if (tabs == null || content == null) {
return super.calcAutoSize(exclusions);
}

var size = super.calcAutoSize(exclusions);
if (content.autoHeight) {
var modifier = 0 - marginTop(tabs);
if (component.hasClass(":bottom")) {
modifier = -1 - marginTop(tabs);
}
size.height = tabs.height + content.height + modifier;
}
return size;
}
}

//***********************************************************************************************************
Expand Down

0 comments on commit 4d3973d

Please sign in to comment.