aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2022-10-21 22:02:00 +0200
committernea <romangraef@gmail.com>2022-10-21 22:02:00 +0200
commit5b158541411e0fa93110c030326963f38a724d07 (patch)
tree5f129a8d3dd1bbb8a34af8cf028948e8b4470d69
parentccee8433f74f83cb5360e5668276d104b35629ac (diff)
downloadLibGui-feature/gaps.tar.gz
LibGui-feature/gaps.tar.bz2
LibGui-feature/gaps.zip
Various formatting changesfeature/gaps
-rw-r--r--GuiTest/src/main/java/io/github/cottonmc/test/client/PaddingTestGui.java1
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WGridPanel.java13
2 files changed, 5 insertions, 9 deletions
diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/client/PaddingTestGui.java b/GuiTest/src/main/java/io/github/cottonmc/test/client/PaddingTestGui.java
index 105c13b..367cab0 100644
--- a/GuiTest/src/main/java/io/github/cottonmc/test/client/PaddingTestGui.java
+++ b/GuiTest/src/main/java/io/github/cottonmc/test/client/PaddingTestGui.java
@@ -5,7 +5,6 @@ import io.github.cottonmc.cotton.gui.widget.WGridPanel;
import io.github.cottonmc.cotton.gui.widget.WLabel;
import io.github.cottonmc.cotton.gui.widget.data.HorizontalAlignment;
import io.github.cottonmc.cotton.gui.widget.data.Insets;
-
import io.github.cottonmc.cotton.gui.widget.data.VerticalAlignment;
import net.minecraft.text.Text;
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WGridPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WGridPanel.java
index 121d042..22139e9 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WGridPanel.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WGridPanel.java
@@ -7,7 +7,6 @@ import io.github.cottonmc.cotton.gui.widget.data.Insets;
* A panel that positions children in a grid.
*/
public class WGridPanel extends WPanelWithInsets {
-
private static final VisualLogger LOGGER = new VisualLogger(WGridPanel.class);
/**
@@ -29,17 +28,14 @@ public class WGridPanel extends WPanelWithInsets {
/**
* Constructs a grid panel with the default grid size.
*/
- public WGridPanel() {
- }
+ public WGridPanel() {}
/**
* Constructs a grid panel with a custom grid size.
*
* @param gridSize the grid size in pixels
*/
- public WGridPanel(int gridSize) {
- this.grid = gridSize;
- }
+ public WGridPanel(int gridSize) { this.grid = gridSize; }
/**
@@ -50,13 +46,14 @@ public class WGridPanel extends WPanelWithInsets {
* @param horizontalGap the horizontal gap between grid cells
* @param verticalGap the vertical gap between grid cells
*/
- public void setGaps(int horizontalGap, int verticalGap) {
+ public WGridPanel setGaps(int horizontalGap, int verticalGap) {
if (!this.children.isEmpty()) {
LOGGER.warn("You can only change gaps before adding children to a WGridPanel");
- return;
+ return this;
}
this.horizontalGap = horizontalGap;
this.verticalGap = verticalGap;
+ return this;
}