Created
May 20, 2023 12:10
-
-
Save isXander/8d11b78df97cb14000c638ea0d0d65d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rootLayout = layout.createRowHelper(3); | |
rootLayout.addChild(new TabListWidget<>( | |
() -> new ScreenRectangle(tabArea.position(), tabArea.width() / 3 * 2 + 1, tabArea.height()), | |
this.optionList | |
), 2); | |
var buttonGrid = new GridLayout(); | |
buttonGrid.defaultCellSetting().padding(2, 2, 2, 0); | |
rootLayout.addChild(buttonGrid, 1, rootLayout.newCellSettings().alignHorizontallyRight().alignVerticallyBottom()); | |
int columnWidth = width / 3; | |
int padding = columnWidth / 20; | |
columnWidth = Math.min(columnWidth, 400); | |
int paddedWidth = columnWidth - padding * 2; | |
saveFinishedButton = Button.builder(Component.literal("Done"), btn -> {}).width(paddedWidth).build(); | |
cancelResetButton = Button.builder(Component.literal("Cancel"), btn -> {}).width(paddedWidth / 2 - 2).build(); | |
undoButton = Button.builder(Component.literal("Undo"), btn -> {}).width(paddedWidth / 2 - 2).build(); | |
var buttonLayout = buttonGrid.createRowHelper(2); | |
buttonLayout.addChild(cancelResetButton, 1); | |
buttonLayout.addChild(undoButton, 1); | |
buttonLayout.addChild(saveFinishedButton, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment