From 7b8f4767daa9dda90c2d28d3988cbc19615203b0 Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Mon, 27 Nov 2023 22:48:53 +0000 Subject: [PATCH] feat: rename icon folder to logo folder and update rendering of UI Former-commit-id: 7eb822d0c583a67a90aaed0c7f1a2ecd0a2613fd --- .../{icon => logo}/ambition-2x-nobg-white.png | Bin assets/{icon => logo}/ambition-2x.png | Bin assets/{icon => logo}/ambition-nobg-white.png | Bin assets/{icon => logo}/ambition.png | Bin assets/{icon => logo}/ambition.svg | 0 src/main.rs | 48 +++++++++++------- 6 files changed, 30 insertions(+), 18 deletions(-) rename assets/{icon => logo}/ambition-2x-nobg-white.png (100%) rename assets/{icon => logo}/ambition-2x.png (100%) rename assets/{icon => logo}/ambition-nobg-white.png (100%) rename assets/{icon => logo}/ambition.png (100%) rename assets/{icon => logo}/ambition.svg (100%) diff --git a/assets/icon/ambition-2x-nobg-white.png b/assets/logo/ambition-2x-nobg-white.png similarity index 100% rename from assets/icon/ambition-2x-nobg-white.png rename to assets/logo/ambition-2x-nobg-white.png diff --git a/assets/icon/ambition-2x.png b/assets/logo/ambition-2x.png similarity index 100% rename from assets/icon/ambition-2x.png rename to assets/logo/ambition-2x.png diff --git a/assets/icon/ambition-nobg-white.png b/assets/logo/ambition-nobg-white.png similarity index 100% rename from assets/icon/ambition-nobg-white.png rename to assets/logo/ambition-nobg-white.png diff --git a/assets/icon/ambition.png b/assets/logo/ambition.png similarity index 100% rename from assets/icon/ambition.png rename to assets/logo/ambition.png diff --git a/assets/icon/ambition.svg b/assets/logo/ambition.svg similarity index 100% rename from assets/icon/ambition.svg rename to assets/logo/ambition.svg diff --git a/src/main.rs b/src/main.rs index a225f70..a634260 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,7 +28,6 @@ lazy_static!{ fn main() { App::new() - .insert_resource(ClearColor(HYPERNOVA.get("DARK_GRAY").copied().unwrap())) .add_plugins(DefaultPlugins) .add_systems( Startup, @@ -65,28 +64,41 @@ fn render_ui( commands .spawn(NodeBundle { style: Style { - // fill the entire window width: Val::Percent(100.), - flex_direction: FlexDirection::Column, - align_items: AlignItems::Center, + height: Val::Percent(100.0), + justify_content: JustifyContent::SpaceBetween, ..Default::default() }, - background_color: BackgroundColor(Color::BLACK), + background_color: BackgroundColor(HYPERNOVA.get("DARK_GRAY").copied().unwrap()), ..Default::default() }) - .with_children(|builder| { - builder.spawn( - TextBundle::from_section("Ambition", text_style.clone()) - .with_text_alignment(TextAlignment::Center) - .with_style(Style { - position_type: PositionType::Absolute, - margin: UiRect { - top: Val::Percent(10.), - ..default() - }, - ..default() - }), - ); + .with_children(|parent| { + parent + .spawn(NodeBundle { + style: Style { + width: Val::Percent(100.), + height: Val::Percent(100.0), + flex_direction: FlexDirection::Column, + align_items: AlignItems::Center, + ..Default::default() + }, + background_color: BackgroundColor(HYPERNOVA.get("DARK_GRAY").copied().unwrap()), + ..Default::default() + }) + .with_children(|parent| { + parent + .spawn(TextBundle::from_section("Ambition", text_style.clone()) + .with_text_alignment(TextAlignment::Center) + .with_style(Style { + position_type: PositionType::Absolute, + margin: UiRect { + top: Val::Percent(10.), + ..default() + }, + ..default() + }) + ); + }); } ); }