refactor: Use Node::from_padding helper
This commit is contained in:
@@ -44,28 +44,19 @@ fn setup(mut commands: Commands) {
|
|||||||
button(
|
button(
|
||||||
shop::components::ButtonType::ShopOpen,
|
shop::components::ButtonType::ShopOpen,
|
||||||
ButtonVariant::Secondary,
|
ButtonVariant::Secondary,
|
||||||
Node {
|
Node::from_padding(UiRect::all(px(10))),
|
||||||
padding: UiRect::all(px(10)),
|
|
||||||
..default()
|
|
||||||
},
|
|
||||||
|color| text("Shop [P]", 16.0, color)
|
|color| text("Shop [P]", 16.0, color)
|
||||||
),
|
),
|
||||||
button(
|
button(
|
||||||
inventory::components::ButtonType::InventoryOpen,
|
inventory::components::ButtonType::InventoryOpen,
|
||||||
ButtonVariant::Secondary,
|
ButtonVariant::Secondary,
|
||||||
Node {
|
Node::from_padding(UiRect::all(px(10))),
|
||||||
padding: UiRect::all(px(10)),
|
|
||||||
..default()
|
|
||||||
},
|
|
||||||
|color| text("Inventar", 16.0, color)
|
|color| text("Inventar", 16.0, color)
|
||||||
),
|
),
|
||||||
button(
|
button(
|
||||||
ButtonType::SettingsOpen,
|
ButtonType::SettingsOpen,
|
||||||
ButtonVariant::Secondary,
|
ButtonVariant::Secondary,
|
||||||
Node {
|
Node::from_padding(UiRect::all(px(10))),
|
||||||
padding: UiRect::all(px(10)),
|
|
||||||
..default()
|
|
||||||
},
|
|
||||||
|color| text("Einstellungen", 16.0, color)
|
|color| text("Einstellungen", 16.0, color)
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -70,10 +70,7 @@ pub fn open_context_menu(
|
|||||||
action: option.clone(),
|
action: option.clone(),
|
||||||
},
|
},
|
||||||
ButtonVariant::Primary,
|
ButtonVariant::Primary,
|
||||||
Node {
|
Node::from_padding(UiRect::all(px(5))),
|
||||||
padding: UiRect::all(px(5)),
|
|
||||||
..default()
|
|
||||||
},
|
|
||||||
|c| text(option.clone().get_name(&game_config), 20.0, c), // TODO: add sprite
|
|c| text(option.clone().get_name(&game_config), 20.0, c), // TODO: add sprite
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -81,10 +78,7 @@ pub fn open_context_menu(
|
|||||||
parent.spawn(button(
|
parent.spawn(button(
|
||||||
ButtonType::Cancel,
|
ButtonType::Cancel,
|
||||||
ButtonVariant::Destructive,
|
ButtonVariant::Destructive,
|
||||||
Node {
|
Node::from_padding(UiRect::all(px(5))),
|
||||||
padding: UiRect::all(px(5)),
|
|
||||||
..default()
|
|
||||||
},
|
|
||||||
|c| text("Abbrechen", 20.0, c),
|
|c| text("Abbrechen", 20.0, c),
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user