Logging
This commit is contained in:
@@ -39,6 +39,7 @@ use std::collections::HashMap;
|
||||
const USER_FONT: Font = Font::with_name("Noto Sans JP");
|
||||
|
||||
fn main() -> iced::Result {
|
||||
println!("Welcome to JapLearn");
|
||||
iced::application(ScreenState::boot, ScreenState::update, ScreenState::view).window(window::Settings{
|
||||
position: Position::Centered,
|
||||
min_size: Some(Size::new(700.0_f32.into(), 700.0_f32.into())),
|
||||
|
||||
@@ -84,7 +84,9 @@ pub struct ScreenState {
|
||||
|
||||
impl ScreenState {
|
||||
pub fn boot() -> (ScreenState, Task<RootMessage>) {
|
||||
println!("Booting");
|
||||
create_db();
|
||||
println!("Db created");
|
||||
let state = ScreenState::default();
|
||||
let reading_additional_task = Task::perform(Self::load_additional_data(), |data| data);
|
||||
|
||||
@@ -107,6 +109,7 @@ impl ScreenState {
|
||||
}
|
||||
|
||||
drop(state_guard);
|
||||
println!("Boot finished");
|
||||
(state, final_task)
|
||||
}
|
||||
|
||||
@@ -148,6 +151,7 @@ impl ScreenState {
|
||||
}
|
||||
|
||||
pub fn update(&mut self, message: RootMessage) -> Task<RootMessage> {
|
||||
println!("Updating");
|
||||
let time = Instant::now();
|
||||
if let Keyboard(e) = message {
|
||||
return self.handle_keyboard(e);
|
||||
@@ -214,6 +218,7 @@ impl ScreenState {
|
||||
}
|
||||
|
||||
pub fn view(&self) -> Element<'_, RootMessage> {
|
||||
println!("View update");
|
||||
let time = Instant::now();
|
||||
let view = view_navigation!(
|
||||
self.stack,
|
||||
|
||||
Reference in New Issue
Block a user