Fixes issue where, if a CheckBox was constructed as checked, the proper fore/background colors weren't set.
@@ -2,6 +2,7 @@ package com.valkryst.VTerminal.component;
import com.valkryst.VTerminal.Screen;
+import com.valkryst.VTerminal.Tile;
import com.valkryst.VTerminal.builder.CheckBoxBuilder;
import com.valkryst.VTerminal.palette.ColorPalette;
import lombok.Getter;
@@ -51,6 +52,11 @@ public class CheckBox extends Button {
if (isChecked) {
super.tiles.getTileAt(0, 0).setCharacter(checkedBoxChar);
+
+ for (final Tile tile : super.tiles.getRow(0)) {
+ tile.setBackgroundColor(backgroundColor_pressed);
+ tile.setForegroundColor(foregroundColor_pressed);
+ }
}
}
