Migrate to iced 0.14.0
This commit is contained in:
+7
-2
@@ -9,10 +9,12 @@ use crate::selector::*;
|
||||
use crate::writing::{WritingMessage, WritingState};
|
||||
use crate::Page::{Quiz, Selector, Writing};
|
||||
use iced::widget::text;
|
||||
use iced::Task;
|
||||
use iced::Element;
|
||||
|
||||
fn main() -> iced::Result {
|
||||
iced::application("A kana learn app", ScreenState::update, ScreenState::view).run()
|
||||
iced::application(ScreenState::boot, ScreenState::update, ScreenState::view)
|
||||
.title("Kana learn app").run()
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -48,6 +50,9 @@ impl Default for ScreenState {
|
||||
}
|
||||
|
||||
impl ScreenState {
|
||||
pub fn boot() -> (ScreenState, Task<RootMessage>){
|
||||
(ScreenState::default(), Task::none())
|
||||
}
|
||||
pub fn update(&mut self, message: RootMessage) {
|
||||
state_update!(message, self.stack, Selector, Quiz, Writing);
|
||||
}
|
||||
@@ -101,4 +106,4 @@ macro_rules! message_navigation {
|
||||
|
||||
trait NavigatedPage<T> {
|
||||
fn navigate(&self, message: &T) -> Option<Page>;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -98,7 +98,7 @@ impl QuizState {
|
||||
iced::widget::column![
|
||||
row![
|
||||
text!("{}", self.kana.to_uppercase())
|
||||
.size(48)
|
||||
.size(54)
|
||||
.font(Font::with_name("AppleGothic")),
|
||||
text!(
|
||||
"{}",
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ impl SelectorState {
|
||||
|
||||
let mut chars_column: Column<'_, _> = Column::new();
|
||||
chars_column =
|
||||
chars_column.push(checkbox("", self.set.include_map[i]).on_toggle(setup_checked));
|
||||
chars_column.push(checkbox(self.set.include_map[i]).on_toggle(setup_checked));
|
||||
|
||||
for v in &self.set.dictionary[i] {
|
||||
chars_column = chars_column.push(
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ impl WritingState {
|
||||
.size(36)
|
||||
.into()
|
||||
} else {
|
||||
vertical_space().height(36).into()
|
||||
space().height(36).into()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user