Skip to content

Commit

Permalink
add toggle variants of the button styles
Browse files Browse the repository at this point in the history
  • Loading branch information
xzxADIxzx committed Feb 13, 2025
1 parent 91b574d commit 89bf41b
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/java/schema/ui/Style.java
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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;
}
}

0 comments on commit 89bf41b

Please sign in to comment.