fix(renderer): update color settings for toggled state in CustomButton and CustomSwitch

feat(demo): add Switch and update Button control types in DemoModule
This commit is contained in:
extio-de
2025-12-29 21:57:23 +01:00
parent eb0b2d853c
commit be625f9dce
3 changed files with 21 additions and 10 deletions

View File

@@ -84,7 +84,7 @@ public class CustomButton extends CustomAbstractButton {
g2d.setColor(theme.getTextNormal().adjustBrightness(theme.getHoverBrightnessAdjustment()).toColor());
}
else if ((this.state & STATE_TOGGLED) != 0) {
g2d.setColor(theme.getSelectionPrimary().toColor());
g2d.setColor(theme.getTextNormal().adjustBrightness(theme.getHoverBrightnessAdjustment()).toColor());
}
else if (this.isEnabled()) {
g2d.setColor(theme.getTextNormal().toColor());

View File

@@ -85,7 +85,7 @@ public class CustomSwitch extends CustomAbstractButton {
g2d.setColor(theme.getTextNormal().adjustBrightness(theme.getHoverBrightnessAdjustment()).toColor());
}
else if ((this.state & STATE_TOGGLED) != 0) {
g2d.setColor(theme.getSelectionPrimary().toColor());
g2d.setColor(theme.getTextNormal().adjustBrightness(theme.getHoverBrightnessAdjustment()).toColor());
}
else if (this.isEnabled()) {
g2d.setColor(theme.getTextNormal().toColor());
@@ -93,7 +93,6 @@ public class CustomSwitch extends CustomAbstractButton {
else {
g2d.setColor(theme.getTextDisabled().toColor());
}
final var textDim = G2DDrawFont.getTextDimensions(this.caption, g2d, this.fontSize, this.scaleFactor);
G2DDrawFont.renderText(g2d,
textDim,