Adding words by parts
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
use crate::AppState;
|
||||
use crate::data_provider::card_sets::{delete_set, update_card_set};
|
||||
use crate::lang::CardSetSettings;
|
||||
use crate::navigation::Page::PreviousPage;
|
||||
use crate::navigation::{NavigatedPage, Page, RootMessage};
|
||||
use crate::repetition_settings::RepetitionSettingsMessage::*;
|
||||
use crate::styling::*;
|
||||
use crate::AppState;
|
||||
use iced::widget::button::danger;
|
||||
use iced::widget::{button, column, row, scrollable, space, text, text_input};
|
||||
use iced::{Element, Task};
|
||||
@@ -11,7 +12,6 @@ use iced_core::Length::Fill;
|
||||
use iced_core::Padding;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::time::Duration;
|
||||
use crate::lang::CardSetSettings;
|
||||
|
||||
pub struct RepetitionSettingsState {
|
||||
set: CardSetSettings,
|
||||
@@ -45,8 +45,7 @@ impl NavigatedPage<RepetitionSettingsMessage> for RepetitionSettingsState {
|
||||
}
|
||||
}
|
||||
|
||||
fn navigated(&mut self) {
|
||||
}
|
||||
fn navigated(&mut self) {}
|
||||
fn update(&mut self, message: RepetitionSettingsMessage) -> Task<RootMessage> {
|
||||
match message {
|
||||
Back => {}
|
||||
@@ -84,7 +83,7 @@ impl NavigatedPage<RepetitionSettingsMessage> for RepetitionSettingsState {
|
||||
delete_set(&self.set, &state.connection);
|
||||
state.card_sets.remove(self.index);
|
||||
return Task::done(RootMessage::RepetitionSettings(Back));
|
||||
},
|
||||
}
|
||||
RevertDeleteSet => self.real_delete = false,
|
||||
}
|
||||
Task::none()
|
||||
@@ -142,16 +141,14 @@ impl NavigatedPage<RepetitionSettingsMessage> for RepetitionSettingsState {
|
||||
]
|
||||
.spacing(DEFAULT_SPACING),
|
||||
]
|
||||
.spacing(DEFAULT_SPACING)
|
||||
.into(),
|
||||
.spacing(DEFAULT_SPACING)
|
||||
.into(),
|
||||
Back,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl RepetitionSettingsState {
|
||||
|
||||
|
||||
fn count_view(&self, set: &CardSetSettings) -> Element<'_, RepetitionSettingsMessage> {
|
||||
if let Some(count) = set.count {
|
||||
return text!("Количество слов: {}", count).into();
|
||||
|
||||
Reference in New Issue
Block a user