Import page base
This commit is contained in:
+22
-12
@@ -27,7 +27,7 @@ use crate::quiz::*;
|
||||
use crate::repetitions::CardSetSettings;
|
||||
use crate::RootMessage::Keyboard;
|
||||
use chrono::NaiveDate;
|
||||
use iced::{keyboard, Subscription, Theme};
|
||||
use iced::{keyboard, Program, Subscription, Theme};
|
||||
use iced::{window, Font};
|
||||
use iced_core::window::Position;
|
||||
use iced_core::Size;
|
||||
@@ -39,15 +39,7 @@ 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())),
|
||||
platform_specific: PlatformSpecific {
|
||||
application_id: "JapLearn".to_string(),
|
||||
override_redirect: false
|
||||
},
|
||||
.. Default::default()
|
||||
})
|
||||
iced::application(ScreenState::boot, ScreenState::update, ScreenState::view).window(window_settings())
|
||||
.subscription(subscription)
|
||||
.title("JapLearn")
|
||||
.settings(iced::Settings {
|
||||
@@ -56,8 +48,26 @@ fn main() -> iced::Result {
|
||||
})
|
||||
.font(include_bytes!("../noto.ttf"))
|
||||
.default_font(USER_FONT)
|
||||
.theme(Theme::GruvboxDark)
|
||||
.run()
|
||||
.theme(Theme::GruvboxDark).run()
|
||||
}
|
||||
|
||||
fn window_settings() -> window::Settings {
|
||||
let mut settings = window::Settings{
|
||||
position: Position::Centered,
|
||||
min_size: Some(Size::new(700.0_f32.into(), 700.0_f32.into())),
|
||||
.. Default::default()
|
||||
};
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
settings.platform_specific =
|
||||
PlatformSpecific {
|
||||
application_id: "JapLearn".to_string(),
|
||||
override_redirect: false
|
||||
};
|
||||
}
|
||||
|
||||
settings
|
||||
}
|
||||
|
||||
fn subscription(_state: &ScreenState) -> Subscription<RootMessage> {
|
||||
|
||||
Reference in New Issue
Block a user