fix(android): 48dp min hit targets on action buttons
Action buttons sized to text + 8 px padding made "Undo" end up ~46 x 33 px — fine for a mouse but at the threshold of a finger. Adds `min_width: 48 px` and `min_height: 48 px` to the button Node so every button meets Material's 48 dp thumb-target guideline. Applied universally; the floor is a no-op for buttons whose content already exceeds 48 px on either axis (Menu, Modes, New Game, Pause, Help all clear 48 px wide; height was the binding constraint at ~33 px). Closes P1 #2 of docs/android/PLAYABILITY_TODO.md. Engine tests pass; clippy clean. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -764,6 +764,14 @@ fn spawn_action_button<M: Component>(
|
||||
// companion commit). Vertical padding stays at VAL_SPACE_2
|
||||
// so button height tracks the rest of the chrome band.
|
||||
padding: UiRect::axes(VAL_SPACE_2, VAL_SPACE_2),
|
||||
// 48 px floors meet Material's recommended thumb-target
|
||||
// size on touch and are a no-op on desktop for buttons
|
||||
// whose content already exceeds 48 px in either axis
|
||||
// (Menu, Modes, New Game, etc.). Without these, "Undo"
|
||||
// ends up ~46 × 33 px — comfortably tappable with a mouse
|
||||
// but right at the threshold for a finger.
|
||||
min_width: Val::Px(48.0),
|
||||
min_height: Val::Px(48.0),
|
||||
justify_content: JustifyContent::Center,
|
||||
align_items: AlignItems::Center,
|
||||
border_radius: BorderRadius::all(Val::Px(RADIUS_MD)),
|
||||
|
||||
Reference in New Issue
Block a user