Convert BigRedButton ctor into just a Bundle

The BigRedButton isn't doing anything that requires the `Commands`, so
it'll be turned back into just a Bundle.
This commit is contained in:
2025-08-26 13:01:49 -05:00
parent c567bc3706
commit 9bb15b7511

View File

@@ -91,9 +91,12 @@ fn machine_ui_base(commands: &mut Commands, header: impl Into<String>, theme: &U
pub struct BigRedButton;
impl BigRedButton {
// TODO: Hook up action handling (callback? Observer? Some other weird component?)
fn spawn_big_red_button(commands: &mut ChildSpawnerCommands, text: impl Into<String>) {
let mut builder = commands.spawn((
/// Default bundle for a Big Red Button. Remember to attach on-press observers!
///
/// I haven't figure out what will receive the on-press events, so I'm moving
/// the problem. It will not be the button's job to hook up the event notice.
fn bundle(text: impl Into<String>) -> impl Bundle {
(
Button,
BigRedButton,
Node {
@@ -117,7 +120,7 @@ impl BigRedButton {
TextColor(WHITE.into()),
TextShadow::default(),
],
));
);
}
/// Re-color the button when a pointer passes over it