Code cleanup
This commit is contained in:
1 parent
1ad991667b
commit
f66bf69ef5
32 files changed
+234
-899
No files matched your search
@@ -1,4 +1,7 @@
|
||||
use crate::app::AppState;
|
||||
use crate::data::entities::{EntityHandle, WordData};
|
||||
use crate::data::repositories::Repository;
|
||||
use crate::jl_button;
|
||||
use crate::navigation::Page::PreviousPage;
|
||||
use crate::navigation::RootMessage;
|
||||
use crate::navigation::*;
|
||||
@@ -6,15 +9,12 @@ use crate::pages::dictionary::split_with_coma;
|
||||
use crate::pages::dictionary_quiz::DictionaryQuizMessage::*;
|
||||
use crate::pages::quiz::Score;
|
||||
use crate::styling::*;
|
||||
use iced::Background::Color;
|
||||
use iced::border::Radius;
|
||||
use iced::widget::container::Style;
|
||||
use iced::widget::{Row, button, container, row, space, text, text_input};
|
||||
use iced::{Border, Element, Fill, Task, Theme, alignment};
|
||||
use iced::widget::{container, row, space, text, text_input, Row};
|
||||
use iced::Background::Color;
|
||||
use iced::{alignment, Border, Element, Fill, Task, Theme};
|
||||
use rand::prelude::SliceRandom;
|
||||
use crate::app::AppState;
|
||||
use crate::data::repositories::Repository;
|
||||
use crate::jl_button;
|
||||
|
||||
pub struct DictionaryQuizState {
|
||||
state: AppState,
|
||||
@@ -91,11 +91,8 @@ impl NavigatedPage<DictionaryQuizMessage> for DictionaryQuizState {
|
||||
.size(25),
|
||||
]
|
||||
.spacing(DEFAULT_SPACING),
|
||||
row![
|
||||
jl_button!("Закончить").on_press(Back),
|
||||
self.appeal_button()
|
||||
]
|
||||
.spacing(DEFAULT_SPACING),
|
||||
row![jl_button!("Закончить").on_press(Back), self.appeal_button()]
|
||||
.spacing(DEFAULT_SPACING),
|
||||
]
|
||||
.spacing(DEFAULT_SPACING)
|
||||
.align_x(alignment::Horizontal::Center),
|
||||
@@ -107,8 +104,13 @@ impl NavigatedPage<DictionaryQuizMessage> for DictionaryQuizState {
|
||||
}
|
||||
|
||||
impl DictionaryQuizState {
|
||||
pub fn new(words: Vec<EntityHandle<WordData>>, reverse: bool, no_typing: bool, state: AppState) -> DictionaryQuizState {
|
||||
let state = DictionaryQuizState {
|
||||
pub fn new(
|
||||
words: Vec<EntityHandle<WordData>>,
|
||||
reverse: bool,
|
||||
no_typing: bool,
|
||||
state: AppState,
|
||||
) -> DictionaryQuizState {
|
||||
Self {
|
||||
state,
|
||||
words,
|
||||
current_set: Vec::new(),
|
||||
@@ -120,9 +122,7 @@ impl DictionaryQuizState {
|
||||
reverse,
|
||||
laps: 0,
|
||||
no_typing,
|
||||
};
|
||||
|
||||
state
|
||||
}
|
||||
}
|
||||
|
||||
fn submit(&mut self) {
|
||||
|
||||
Reference in new issue
Block a user