diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-05-07 12:06:43 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-05-07 12:06:43 +0200 |
commit | 28eb14969329b0cbf6e97c9d62917b17078bba0b (patch) | |
tree | 99edd2a4bb8eb2075fe5dd08da8dc524b337c262 | |
parent | caf138d3eb2202c2dc9634f79d2965267548e593 (diff) | |
download | OneConfig-28eb14969329b0cbf6e97c9d62917b17078bba0b.tar.gz OneConfig-28eb14969329b0cbf6e97c9d62917b17078bba0b.tar.bz2 OneConfig-28eb14969329b0cbf6e97c9d62917b17078bba0b.zip |
change a font size of button
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java | 5 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java index c76e029..0db6eac 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java @@ -10,6 +10,8 @@ import cc.polyfrost.oneconfig.utils.ColorUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.awt.*; + public class BasicButton extends BasicElement { protected String text; @@ -44,7 +46,8 @@ public class BasicButton extends BasicElement { fontSize = 24f; this.colorPalette = -1; } else { - fontSize = 14f; + if (colorPalette == 0) fontSize = 12; + else fontSize = 14f; this.colorPalette = colorPalette; } } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java index b529778..fa40b12 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java @@ -125,8 +125,7 @@ public class ModConfigPage extends Page { if(categories.size() <= 1) return 0; int buttonX = x + 16; for (BasicButton button : categories) { - if (button.getWidth() == 0) - button.setWidth((int) (Math.ceil(RenderManager.getTextWidth(vg, button.getText(), 14f, Fonts.MEDIUM) / 8f) * 8 + 16)); + if (button.getWidth() == 0) button.setWidth((int) (Math.ceil(RenderManager.getTextWidth(vg, button.getText(), 12f, Fonts.MEDIUM) / 8f) * 8 + 16)); button.draw(vg, buttonX, y + 16); buttonX += button.getWidth() + 16; } |