Include font and style changes
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ use iced::Element;
|
||||
|
||||
fn main() -> iced::Result {
|
||||
iced::application(ScreenState::boot, ScreenState::update, ScreenState::view)
|
||||
.title("Kana learn app").run()
|
||||
.title("Kana learn app").font(include_bytes!("../noto.ttf")).run()
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@ use crate::lang::KanaSet;
|
||||
use crate::Page::PreviousPage;
|
||||
use crate::{NavigatedPage, Page};
|
||||
use iced::widget::*;
|
||||
use iced::{alignment, Element, Fill, Font};
|
||||
use iced::{alignment, Element, Fill};
|
||||
use rand::seq::SliceRandom;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -97,8 +97,7 @@ impl QuizState {
|
||||
iced::widget::column![
|
||||
row![
|
||||
text!("{}", self.kana.to_uppercase())
|
||||
.size(54)
|
||||
.font(Font::with_name("AppleGothic")),
|
||||
.size(54),
|
||||
text!(
|
||||
"{}",
|
||||
if self.is_help {
|
||||
@@ -129,6 +128,7 @@ impl QuizState {
|
||||
.spacing(10)
|
||||
.align_x(alignment::Horizontal::Center),
|
||||
)
|
||||
.center_y(Fill)
|
||||
.center_x(Fill)
|
||||
.into()
|
||||
}
|
||||
|
||||
+2
-3
@@ -4,7 +4,7 @@ use crate::writing::WritingState;
|
||||
use crate::Page::{Quiz, Writing};
|
||||
use crate::{NavigatedPage, Page, QuizState};
|
||||
use iced::widget::*;
|
||||
use iced::{alignment, Element, Font};
|
||||
use iced::{alignment, Element};
|
||||
|
||||
pub struct SelectorState {
|
||||
pub set: KanaSet,
|
||||
@@ -87,8 +87,7 @@ impl SelectorState {
|
||||
chars_column = chars_column.push(
|
||||
container(
|
||||
text!("{}", v.0.clone().to_uppercase())
|
||||
.size(36)
|
||||
.font(Font::with_name("AppleGothic")),
|
||||
.size(36),
|
||||
)
|
||||
.padding(20)
|
||||
.style(container::rounded_box),
|
||||
|
||||
+4
-12
@@ -2,7 +2,7 @@ use crate::lang::KanaSet;
|
||||
use crate::Page::PreviousPage;
|
||||
use crate::{NavigatedPage, Page};
|
||||
use iced::widget::*;
|
||||
use iced::{alignment, Element, Fill, Font};
|
||||
use iced::{alignment, Element, Fill};
|
||||
use rand::seq::SliceRandom;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -12,7 +12,6 @@ pub struct WritingState {
|
||||
original_set: Vec<(String, String)>,
|
||||
kana_total: String,
|
||||
roman_total: String,
|
||||
is_help: bool,
|
||||
next_text: String,
|
||||
}
|
||||
|
||||
@@ -36,7 +35,6 @@ impl WritingState {
|
||||
original_set: list,
|
||||
kana_total: "".to_string(),
|
||||
roman_total: "".to_string(),
|
||||
is_help: false,
|
||||
next_text: "Дальше".to_string(),
|
||||
}
|
||||
}
|
||||
@@ -82,13 +80,14 @@ impl WritingState {
|
||||
.align_x(alignment::Horizontal::Center),
|
||||
)
|
||||
.center_x(Fill)
|
||||
.center_y(Fill)
|
||||
.padding(10)
|
||||
.into()
|
||||
}
|
||||
|
||||
fn answers(&self) -> Element<'_, WritingMessage> {
|
||||
if self.set.is_empty() {
|
||||
text!("{}", self.kana_total)
|
||||
.font(Font::with_name("AppleGothic"))
|
||||
.size(36)
|
||||
.into()
|
||||
} else {
|
||||
@@ -100,11 +99,4 @@ impl WritingState {
|
||||
pub enum WritingMessage {
|
||||
Next,
|
||||
Back,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone)]
|
||||
pub struct Score {
|
||||
total: i32,
|
||||
correct: i32,
|
||||
fail: i32,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user