From 40732148da0d7b704a8bfaa6b6f657a95e3feba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Mon, 11 Mar 2024 19:36:52 +0100 Subject: [PATCH] correctly set up background color in mobile example (#12384) # Objective - Since #11165, the button in the mobile example doesn't visually react to touches ## Solution - Correctly set up the background color --- examples/mobile/src/lib.rs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/examples/mobile/src/lib.rs b/examples/mobile/src/lib.rs index 3e2af5d128890..60af2455d52f4 100644 --- a/examples/mobile/src/lib.rs +++ b/examples/mobile/src/lib.rs @@ -104,18 +104,22 @@ fn setup_scene( // Test ui commands - .spawn(ButtonBundle { - style: Style { - justify_content: JustifyContent::Center, - align_items: AlignItems::Center, - position_type: PositionType::Absolute, - left: Val::Px(50.0), - right: Val::Px(50.0), - bottom: Val::Px(50.0), + .spawn(( + ButtonBundle { + style: Style { + justify_content: JustifyContent::Center, + align_items: AlignItems::Center, + position_type: PositionType::Absolute, + left: Val::Px(50.0), + right: Val::Px(50.0), + bottom: Val::Px(50.0), + ..default() + }, + image: UiImage::default().with_color(Color::NONE), ..default() }, - ..default() - }) + BackgroundColor(Color::WHITE), + )) .with_children(|b| { b.spawn( TextBundle::from_section(