Skip to content

Restyle UI#8

Merged
manuelmauro merged 12 commits intomainfrom
feat/ui-restyle
Apr 13, 2026
Merged

Restyle UI#8
manuelmauro merged 12 commits intomainfrom
feat/ui-restyle

Conversation

@manuelmauro
Copy link
Copy Markdown
Owner

Summary

Complete visual overhaul across all screens — all 4 scopes from the Shape Up pitch shipped.

Scope 1: Theme foundation (src/theme.rs)

Centralised design tokens replacing all scattered Color::srgb(0.9, ...) and palette:: references:

  • Colors: BG, SURFACE, SURFACE_ALT, BORDER, TEXT, TEXT_MUTED, ACCENT, GAME_BTN, TIMER_TRACK/FILL
  • Spacing: SP_XS (4) / SP_SM (8) / SP_MD (16) / SP_LG (24) / SP_XL (32)
  • Radii: RADIUS_SM (6) / RADIUS_MD (12) / RADIUS_LG (16) / RADIUS_FULL (9999)

Scope 2: Menu restyle

  • Rounded card containers for N-selector and cue toggles
  • Circular +/- buttons with subtle border
  • Checkboxes with ✓ glyph (toggled via TextColor)
  • Full-width accent PLAY button with dark text
  • Score history with Date column and alternating row tints

Scope 3: Game HUD restyle

  • Timer progress bar — 6px bar below the top bar, accent fill that shifts color at >80%
  • Compact pill buttons — 4 buttons fit across with shortened labels (Pos/Col/Shp/Snd)
  • Themed button states (teal palette for game buttons)

Scope 4: Pause overlay

  • Centered rounded card on dark scrim
  • Resume button (accent green)
  • Quit to Menu button (surface gray) — transitions to AppState::Menu

Technical notes

  • BorderRadius is a field on Node in Bevy 0.18, not a standalone component — cannot be in spawn tuples directly
  • px() is not const — theme spacing uses Val::Px(...) for const correctness

Complete visual overhaul across all screens:

Theme foundation (theme.rs):
- Named color constants: BG, SURFACE, SURFACE_ALT, BORDER, TEXT,
  TEXT_MUTED, ACCENT, GAME_BTN, TIMER_TRACK/FILL
- Spacing constants: SP_XS/SM/MD/LG/XL
- Border radius constants: RADIUS_SM/MD/LG/FULL
- Replaces all scattered Color::srgb(0.9, 0.9, 0.9) and palette refs

Menu restyle:
- Rounded card containers for N-selector and cue toggles
- Circular +/- buttons with border
- Checkboxes show ✓ glyph (toggled via TextColor visibility)
- Full-width PLAY button with accent background and dark text
- Score history table with Date column, alternating row tints
- Consistent spacing via theme constants

Game HUD restyle:
- Timer progress bar below the top bar (6px, accent fill, color
  shifts when >80% elapsed)
- Compact pill-shaped action buttons that fit 4 across
- Shortened labels: Pos/Col/Shp/Snd with key in parens
- Themed colors for button states

Pause overlay:
- Centered card with rounded corners on dark scrim
- Resume button (accent) and Quit to Menu button (surface)
- PauseAction enum + pause_button_system for button handling

Note: BorderRadius is a Node field in Bevy 0.18, not a Component.
The score history table used a flat grid where BackgroundColor was set
on individual text cells, only tinting the text bounds. Switched to a
column of flex-rows so each row container spans the full width and
carries the alternating background. Rows also get rounded corners.
The ✓ glyph wasn't rendering properly with FiraSans-Bold. Replaced
with a pure UI approach: a small 16x16 rounded Node inside the
checkbox whose BackgroundColor toggles between BG (visible) and
NONE (hidden). No font dependency for the check indicator.
Both query parameters accessed &mut BackgroundColor — the main
checkbox query on Button entities and the check_marks query on
CheckMark entities. Bevy couldn't prove disjointness, causing a
panic at startup. Adding Without<Button> to check_marks makes
the queries provably disjoint.
Adds a 'Quit' button below PLAY that exits the application via
AppExit::Success. Styled as a subdued surface-alt button with
muted text to keep visual focus on PLAY.
Add align_items: Center to the root column so cards, buttons, and
score history are centered rather than stretched to full width.
All content elements use a fixed 360px width for consistent sizing.
The button system was resetting all buttons to theme::SURFACE on
Interaction::None, overriding the PLAY button's accent background.
Added a RestingColor component that stores each button's resting
color, used to restore it after hover/press.
Remove flex_grow: 1.0 from the score table so it sizes to its
content instead of stretching to fill remaining vertical space.
Show 5 scores per page with ‹/› navigation buttons and a page
indicator. The table rebuilds reactively when the ScorePage resource
changes. Page resets to 0 on menu entry.
@manuelmauro manuelmauro changed the title feat: restyle UI with theme system, rounded corners, and timer bar Restyle UI with theme system, rounded corners, and timer bar Apr 12, 2026
@manuelmauro manuelmauro changed the title Restyle UI with theme system, rounded corners, and timer bar Restyle UI Apr 12, 2026
@manuelmauro manuelmauro merged commit aeb99ce into main Apr 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant