Migrate to iced 0.14.0
This commit is contained in:
Generated
+738
-945
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -4,5 +4,5 @@ version = "0.1.0"
|
|||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
iced = "0.13.1"
|
iced = { version = "0.14.0", features = ["canvas"] }
|
||||||
rand = "0.10.0"
|
rand = "0.10.0"
|
||||||
|
|||||||
+6
-1
@@ -9,10 +9,12 @@ use crate::selector::*;
|
|||||||
use crate::writing::{WritingMessage, WritingState};
|
use crate::writing::{WritingMessage, WritingState};
|
||||||
use crate::Page::{Quiz, Selector, Writing};
|
use crate::Page::{Quiz, Selector, Writing};
|
||||||
use iced::widget::text;
|
use iced::widget::text;
|
||||||
|
use iced::Task;
|
||||||
use iced::Element;
|
use iced::Element;
|
||||||
|
|
||||||
fn main() -> iced::Result {
|
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)]
|
#[derive(Debug, Clone)]
|
||||||
@@ -48,6 +50,9 @@ impl Default for ScreenState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl ScreenState {
|
impl ScreenState {
|
||||||
|
pub fn boot() -> (ScreenState, Task<RootMessage>){
|
||||||
|
(ScreenState::default(), Task::none())
|
||||||
|
}
|
||||||
pub fn update(&mut self, message: RootMessage) {
|
pub fn update(&mut self, message: RootMessage) {
|
||||||
state_update!(message, self.stack, Selector, Quiz, Writing);
|
state_update!(message, self.stack, Selector, Quiz, Writing);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -98,7 +98,7 @@ impl QuizState {
|
|||||||
iced::widget::column![
|
iced::widget::column![
|
||||||
row![
|
row![
|
||||||
text!("{}", self.kana.to_uppercase())
|
text!("{}", self.kana.to_uppercase())
|
||||||
.size(48)
|
.size(54)
|
||||||
.font(Font::with_name("AppleGothic")),
|
.font(Font::with_name("AppleGothic")),
|
||||||
text!(
|
text!(
|
||||||
"{}",
|
"{}",
|
||||||
|
|||||||
+1
-1
@@ -81,7 +81,7 @@ impl SelectorState {
|
|||||||
|
|
||||||
let mut chars_column: Column<'_, _> = Column::new();
|
let mut chars_column: Column<'_, _> = Column::new();
|
||||||
chars_column =
|
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] {
|
for v in &self.set.dictionary[i] {
|
||||||
chars_column = chars_column.push(
|
chars_column = chars_column.push(
|
||||||
|
|||||||
+1
-1
@@ -92,7 +92,7 @@ impl WritingState {
|
|||||||
.size(36)
|
.size(36)
|
||||||
.into()
|
.into()
|
||||||
} else {
|
} else {
|
||||||
vertical_space().height(36).into()
|
space().height(36).into()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user