feat(renderer): add grid overlay to BlueprintPatternRenderer and gradient effect to DreamPatternRenderer

This commit is contained in:
extio-de
2025-12-29 22:57:09 +01:00
parent 8fa370bcbf
commit 1300cb1076
2 changed files with 34 additions and 1 deletions

View File

@@ -197,6 +197,18 @@ public class BlueprintPatternRenderer implements PatternRenderer {
g2d.setColor(bgColor); g2d.setColor(bgColor);
g2d.fillRect(x, y, width, height); g2d.fillRect(x, y, width, height);
// Add blueprint-style grid overlay for larger buttons
if (width > 40 && height > 40) {
g2d.setColor(new Color(255, 255, 255, 25));
final int gridSpacing = 8;
for (int gx = x + gridSpacing; gx < x + width; gx += gridSpacing) {
g2d.drawLine(gx, y + 2, gx, y + height - 2);
}
for (int gy = y + gridSpacing; gy < y + height; gy += gridSpacing) {
g2d.drawLine(x + 2, gy, x + width - 2, gy);
}
}
final var borderStrength = Math.max(1, (int) (2 * scaleFactor)); final var borderStrength = Math.max(1, (int) (2 * scaleFactor));
final var borderColor = (state & STATE_HOVERED) != 0 ? theme.getSelectionPrimary().toColor() : final var borderColor = (state & STATE_HOVERED) != 0 ? theme.getSelectionPrimary().toColor() :
enabled ? theme.getBorderOuter().toColor() : theme.getBorderInnerDisabled().toColor(); enabled ? theme.getBorderOuter().toColor() : theme.getBorderInnerDisabled().toColor();

View File

@@ -184,8 +184,29 @@ public class DreamPatternRenderer implements PatternRenderer {
final var arc = Math.max(6, (int) (10 * scaleFactor)); final var arc = Math.max(6, (int) (10 * scaleFactor));
g2d.setColor(bgColor2); g2d.setColor(bgColor2);
g2d.fillRoundRect(x, y, width, height, arc, arc); g2d.fillRoundRect(x, y, width, height, arc, arc);
// Add vertical gradient overlay for depth
if (height > 20) {
final var gradientColor = new Color(255, 255, 255, 20);
for (int i = 0; i < height / 3; i++) {
g2d.setColor(new Color(255, 255, 255, (int) (20 - (i * 20.0 / (height / 3)))));
g2d.fillRect(x + arc / 2, y + i, width - arc, 1);
}
}
final var borderStrength = Math.max(1, (int) (2 * scaleFactor)); // Add dreamy bubble decorations for toggled buttons
if ((state & STATE_TOGGLED) != 0 && width > 35 && height > 35) {
g2d.setColor(new Color(255, 255, 255, 80));
g2d.fillOval(x + width / 4, y + height / 4, 5, 5);
g2d.fillOval(x + width * 2 / 3, y + height / 3, 3, 3);
g2d.fillOval(x + width / 3, y + height * 2 / 3, 4, 4);
}
// Add soft shimmer effect when hovered
if ((state & STATE_HOVERED) != 0) {
g2d.setColor(new Color(255, 255, 255, 30));
g2d.fillRoundRect(x + 2, y + 2, width - 4, height / 2, arc, arc);
}
final var borderStrength = Math.max(1, (int) (2 * scaleFactor));
final var borderColor = (state & STATE_HOVERED) != 0 ? theme.getSelectionPrimary().toColor() : final var borderColor = (state & STATE_HOVERED) != 0 ? theme.getSelectionPrimary().toColor() :
enabled ? theme.getBorderInner().toColor() : theme.getBorderInnerDisabled().toColor(); enabled ? theme.getBorderInner().toColor() : theme.getBorderInnerDisabled().toColor();
this.drawDecorativeBorder(g2d, x, y, width, height, borderStrength, borderColor); this.drawDecorativeBorder(g2d, x, y, width, height, borderStrength, borderColor);