fix: Center UI button content
This commit is contained in:
@@ -51,8 +51,6 @@ pub fn spawn_load_popup(commands: &mut Commands) {
|
||||
Node {
|
||||
width: px(40),
|
||||
height: px(40),
|
||||
justify_content: JustifyContent::Center,
|
||||
align_items: AlignItems::Center,
|
||||
..default()
|
||||
},
|
||||
"X",
|
||||
@@ -127,8 +125,6 @@ pub fn spawn_load_popup(commands: &mut Commands) {
|
||||
Node {
|
||||
width: px(40),
|
||||
height: px(40),
|
||||
justify_content: JustifyContent::Center,
|
||||
align_items: AlignItems::Center,
|
||||
..default()
|
||||
},
|
||||
"X",
|
||||
|
||||
@@ -37,8 +37,6 @@ fn setup(mut commands: Commands) {
|
||||
ButtonVariant::Primary,
|
||||
Node {
|
||||
width: px(280),
|
||||
justify_content: JustifyContent::Center,
|
||||
align_items: AlignItems::Center,
|
||||
padding: UiRect::all(px(10)),
|
||||
..default()
|
||||
},
|
||||
@@ -50,8 +48,6 @@ fn setup(mut commands: Commands) {
|
||||
ButtonVariant::Primary,
|
||||
Node {
|
||||
width: px(280),
|
||||
justify_content: JustifyContent::Center,
|
||||
align_items: AlignItems::Center,
|
||||
padding: UiRect::all(px(10)),
|
||||
..default()
|
||||
},
|
||||
@@ -63,8 +59,6 @@ fn setup(mut commands: Commands) {
|
||||
ButtonVariant::Secondary,
|
||||
Node {
|
||||
width: px(280),
|
||||
justify_content: JustifyContent::Center,
|
||||
align_items: AlignItems::Center,
|
||||
padding: UiRect::all(px(10)),
|
||||
..default()
|
||||
},
|
||||
|
||||
@@ -3,10 +3,13 @@ use crate::prelude::*;
|
||||
pub fn button(
|
||||
button_type: impl Component,
|
||||
variant: ButtonVariant,
|
||||
node: Node,
|
||||
mut node: Node,
|
||||
title: impl Into<String>,
|
||||
font_size: f32,
|
||||
) -> impl Bundle {
|
||||
node.justify_content = JustifyContent::Center;
|
||||
node.align_items = AlignItems::Center;
|
||||
|
||||
(
|
||||
Button,
|
||||
button_type,
|
||||
@@ -25,10 +28,13 @@ pub fn button(
|
||||
pub fn pill_button(
|
||||
button_type: impl Component,
|
||||
variant: ButtonVariant,
|
||||
node: Node,
|
||||
mut node: Node,
|
||||
title: impl Into<String>,
|
||||
font_size: f32,
|
||||
) -> impl Bundle {
|
||||
node.justify_content = JustifyContent::Center;
|
||||
node.align_items = AlignItems::Center;
|
||||
|
||||
(
|
||||
Button,
|
||||
button_type,
|
||||
|
||||
Reference in New Issue
Block a user