3939import io .github .opencubicchunks .cubicchunks .cubicgen .common .gui .FlatLayersTab ;
4040import io .github .opencubicchunks .cubicchunks .cubicgen .customcubic .gui .UIBlockStateSelect ;
4141
42- public class UIFlatTerrainLayer extends UIContainer <UIFlatTerrainLayer > {
42+ // TODO: avoid actually extending layouts
43+ public final class UIFlatTerrainLayer extends UIVerticalTableLayout <UIFlatTerrainLayer > {
4344
4445 private static final int BTN_WIDTH = 90 ;
4546 private final FlatLayersTab flatLayersTab ;
@@ -57,7 +58,7 @@ public class UIFlatTerrainLayer extends UIContainer<UIFlatTerrainLayer> {
5758 private final FlatCubicGui gui ;
5859
5960 public UIFlatTerrainLayer (FlatCubicGui guiFor , FlatLayersTab flatLayersTabFor , FlatLayer layer ) {
60- super (guiFor );
61+ super (guiFor , 2 );
6162 this .flatLayersTab = flatLayersTabFor ;
6263 this .gui = guiFor ;
6364
@@ -118,14 +119,12 @@ public UIFlatTerrainLayer(FlatCubicGui guiFor, FlatLayersTab flatLayersTabFor, F
118119 UISplitLayout <?> toLayout = new UISplitLayout <>(gui , UISplitLayout .Type .SIDE_BY_SIDE ,
119120 wrap (gui , to ), toField ).setSizeOf (UISplitLayout .Pos .FIRST , 90 ).autoFitToContent (true );
120121
121- UIVerticalTableLayout <?> main = new UIVerticalTableLayout <>( gui , 2 );
122- main .add (blockstateButtonsSplit , new GridLocation (0 , 0 , 2 ));
123- main .add (fromLayout , new GridLocation (0 , 1 , 1 ));
124- main .add (toLayout , new GridLocation (1 , 1 , 1 ));
125- main . add ( separator , new GridLocation ( 0 , 2 , 2 ) );
122+ this . add ( blockstateButtonsSplit , new GridLocation ( 0 , 0 , 2 ) );
123+ this .add (fromLayout , new GridLocation (0 , 1 , 1 ));
124+ this .add (toLayout , new GridLocation (1 , 1 , 1 ));
125+ this .add (separator , new GridLocation (0 , 2 , 2 ));
126+ this . autoFitToContent ( true );
126127
127- add (main );
128- this .setSize (UIComponent .INHERITED , 70 );
129128 }
130129
131130 private void updateLabels () {
0 commit comments