From 89bf41b4f176801aa5f506108db0e9312f3cae3b Mon Sep 17 00:00:00 2001 From: xzxADIxzx <76255437+xzxADIxzx@users.noreply.github.com> Date: Fri, 14 Feb 2025 00:05:31 +0300 Subject: [PATCH] add toggle variants of the button styles --- src/java/schema/ui/Style.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/java/schema/ui/Style.java b/src/java/schema/ui/Style.java index 9a73707..cb8f067 100644 --- a/src/java/schema/ui/Style.java +++ b/src/java/schema/ui/Style.java @@ -11,12 +11,12 @@ public class Style { // region styles - /** Common button, both default and empty variant. */ - public static ButtonStyle cbd, cbe; - /** Image button, both default and empty variant. */ - public static ImageButtonStyle ibd, ibe; - /** Text button, both default and empty variant. */ - public static TextButtonStyle tbd, tbe; + /** Common button, both default, empty and toggle variant. */ + public static ButtonStyle cbd, cbe, cbt; + /** Image button, both default, empty and toggle variant. */ + public static ImageButtonStyle ibd, ibe, ibt; + /** Text button, both default, empty and toggle variant. */ + public static TextButtonStyle tbd, tbe, tbt; // endregion @@ -32,18 +32,21 @@ public static void load() { ibe = new ImageButtonStyle() {{ over = atlas.drawable("schema-button-over"); down = atlas.drawable("schema-button-down"); - disabled = checked = atlas.drawable("schema-button-disabled"); + disabled = atlas.drawable("schema-button-disabled"); }}; ibd = new ImageButtonStyle(ibe) {{ up = atlas.drawable("schema-button"); }}; + ibt = new ImageButtonStyle(ibe) {{ checked = atlas.drawable("schema-button-over"); }}; tbe = new TextButtonStyle() {{ over = atlas.drawable("schema-button-over"); down = atlas.drawable("schema-button-down"); - disabled = checked = atlas.drawable("schema-button-disabled"); + disabled = atlas.drawable("schema-button-disabled"); }}; tbd = new TextButtonStyle(tbe) {{ up = atlas.drawable("schema-button"); }}; + tbt = new TextButtonStyle(tbe) {{ checked = atlas.drawable("schema-button-over"); }}; cbe = tbe; cbd = tbd; + cbt = tbt; } }