diff --git a/dash-frontend/assets/dashboard/check_3d.png b/dash-frontend/assets/dashboard/check_3d.png new file mode 100644 index 00000000..bac93cc3 Binary files /dev/null and b/dash-frontend/assets/dashboard/check_3d.png differ diff --git a/dash-frontend/assets/gui/t_menu_button.xml b/dash-frontend/assets/gui/t_menu_button.xml index 2aed09a0..3029459b 100644 --- a/dash-frontend/assets/gui/t_menu_button.xml +++ b/dash-frontend/assets/gui/t_menu_button.xml @@ -1,16 +1,14 @@ + + + macro="home_button"> - \ No newline at end of file + diff --git a/dash-frontend/assets/gui/tab/home.xml b/dash-frontend/assets/gui/tab/home.xml index 2ad3fc76..9f27bd6b 100644 --- a/dash-frontend/assets/gui/tab/home.xml +++ b/dash-frontend/assets/gui/tab/home.xml @@ -18,6 +18,10 @@ + + + + - \ No newline at end of file + diff --git a/dash-frontend/assets/gui/tab/welcome_common.xml b/dash-frontend/assets/gui/tab/welcome_common.xml index 56caa127..ae0e3af1 100644 --- a/dash-frontend/assets/gui/tab/welcome_common.xml +++ b/dash-frontend/assets/gui/tab/welcome_common.xml @@ -12,6 +12,10 @@ + + + + diff --git a/dash-frontend/assets/gui/tab/welcome_page_5.xml b/dash-frontend/assets/gui/tab/welcome_page_5.xml new file mode 100644 index 00000000..c5db7269 --- /dev/null +++ b/dash-frontend/assets/gui/tab/welcome_page_5.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/dash-frontend/src/tab/home.rs b/dash-frontend/src/tab/home.rs index bb541ee1..a3537045 100644 --- a/dash-frontend/src/tab/home.rs +++ b/dash-frontend/src/tab/home.rs @@ -69,15 +69,15 @@ impl TabHome { let btn_apps = state.fetch_component_as::("btn_apps")?; let btn_games = state.fetch_component_as::("btn_games")?; let btn_monado = state.fetch_component_as::("btn_monado")?; - //let btn_processes = state.fetch_component_as::("btn_processes")?; let btn_settings = state.fetch_component_as::("btn_settings")?; + let btn_welcome_screen = state.fetch_component_as::("btn_welcome_screen")?; let tasks = &mut frontend.tasks; tasks.handle_button(&btn_apps, FrontendTask::SetTab(TabType::Apps)); tasks.handle_button(&btn_games, FrontendTask::SetTab(TabType::Games)); tasks.handle_button(&btn_monado, FrontendTask::SetTab(TabType::Monado)); - //tasks.handle_button(&btn_processes, FrontendTask::SetTab(TabType::Processes)); tasks.handle_button(&btn_settings, FrontendTask::SetTab(TabType::Settings)); + tasks.handle_button(&btn_welcome_screen, FrontendTask::SetTab(TabType::Welcome)); Ok(Self { state, diff --git a/dash-frontend/src/tab/welcome.rs b/dash-frontend/src/tab/welcome.rs index a884d9eb..b7b2eacf 100644 --- a/dash-frontend/src/tab/welcome.rs +++ b/dash-frontend/src/tab/welcome.rs @@ -1,4 +1,4 @@ -use std::marker::PhantomData; +use std::{marker::PhantomData, rc::Rc}; use wgui::{ assets::AssetPath, @@ -10,7 +10,7 @@ use wgui::{ }; use crate::{ - frontend::Frontend, + frontend::{Frontend, FrontendTask, FrontendTasks}, tab::{Tab, TabType}, }; @@ -30,11 +30,12 @@ pub struct TabWelcome { current_page: u8, id_pips: WidgetID, id_content: WidgetID, + frontend_tasks: FrontendTasks, state_tab: Option, } -const PAGE_COUNT: u8 = 5; // 0-4 inclusive +const PAGE_COUNT: u8 = 6; // 0-5 inclusive impl Tab for TabWelcome { fn get_type(&self) -> TabType { @@ -97,6 +98,7 @@ impl TabWelcome { id_content, tasks, state_tab: None, + frontend_tasks: frontend.tasks.clone(), }) } @@ -123,7 +125,7 @@ impl TabWelcome { let globals = layout.state.globals.clone(); - self.state_tab = Some(wgui::parser::parse_from_assets( + let state = wgui::parser::parse_from_assets( &ParseDocumentParams { globals, path: AssetPath::BuiltIn(&format!("gui/tab/welcome_page_{}.xml", self.current_page)), @@ -131,7 +133,19 @@ impl TabWelcome { }, layout, self.id_content, - )?); + )?; + + if let Ok(btn) = state.fetch_component_as::("btn_home_screen") { + btn.on_click({ + let tasks = self.frontend_tasks.clone(); + Rc::new(move |_, _| { + tasks.push(FrontendTask::SetTab(TabType::Home)); + Ok(()) + }) + }); + } + + self.state_tab = Some(state); Ok(()) }