refactor(ui): modal card has hardcoded pixel dimensions — breaks on small screens #67

Closed
opened 2026-05-28 01:52:11 +00:00 by funman300 · 0 comments
Owner

Problem

solitaire_engine/src/ui_modal.rs hardcodes:

  • max_width: Val::Px(720.0)
  • min_width: Val::Px(360.0)

On small Android devices (e.g. a 5" phone in portrait with 320dp usable width) the min-width of 360px is already wider than the screen, causing the modal to overflow or be clipped.

Affected file

solitaire_engine/src/ui_modal.rs

Fix

Replace hardcoded Px values with percentage-based widths:

width: Val::Percent(90.0),
max_width: Val::Px(720.0),  // keep as upper bound only
// remove min_width or set to Val::Percent(80.0)

This makes modals responsive on both phones and tablets without manual breakpoints.

## Problem `solitaire_engine/src/ui_modal.rs` hardcodes: - `max_width: Val::Px(720.0)` - `min_width: Val::Px(360.0)` On small Android devices (e.g. a 5" phone in portrait with 320dp usable width) the min-width of 360px is already wider than the screen, causing the modal to overflow or be clipped. ## Affected file `solitaire_engine/src/ui_modal.rs` ## Fix Replace hardcoded Px values with percentage-based widths: ```rust width: Val::Percent(90.0), max_width: Val::Px(720.0), // keep as upper bound only // remove min_width or set to Val::Percent(80.0) ``` This makes modals responsive on both phones and tablets without manual breakpoints.
funman300 added the androidui labels 2026-05-28 01:52:11 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#67