+8
-6
@@ -6,7 +6,7 @@ use crate::dictionary_test::DictionaryQuizState;
|
||||
use crate::lang::{WordData, WordGroup};
|
||||
use crate::word::WordState;
|
||||
use crate::Page::Word;
|
||||
use crate::{jl_text_input, AppState, NavigatedPage, Page, RootMessage, DEFAULT_SPACING};
|
||||
use crate::{AppState, NavigatedPage, Page, RootMessage, DEFAULT_SPACING};
|
||||
use chrono::{DateTime, TimeDelta, Utc};
|
||||
use iced::alignment::Vertical::Center;
|
||||
use iced::widget::button::Style;
|
||||
@@ -308,6 +308,7 @@ impl DictionaryState {
|
||||
}
|
||||
|
||||
fn words_list(&self) -> iced::Element<'_, DictionaryMessage> {
|
||||
let time = Instant::now();
|
||||
let mut col = Column::new().width(Length::Fill);
|
||||
|
||||
let mut range = (0..self.include_map.len()).collect::<Vec<_>>();
|
||||
@@ -345,21 +346,21 @@ impl DictionaryState {
|
||||
.push(space().width(10));
|
||||
|
||||
line = line.push(
|
||||
jl_text_input("Слово", &word.key)
|
||||
text_input("Слово", &word.key)
|
||||
.size(20)
|
||||
.width(Length::Fill)
|
||||
.on_input(move |string| DictionaryMessage::SetKey(i, string))
|
||||
.on_submit(DictionaryMessage::SubmitWord(i)),
|
||||
);
|
||||
line = line.push(
|
||||
jl_text_input("Перевод", &word.value)
|
||||
text_input("Перевод", &word.value)
|
||||
.size(20)
|
||||
.width(Length::Fill)
|
||||
.on_input(move |string| DictionaryMessage::SetValue(i, string))
|
||||
.on_submit(DictionaryMessage::SubmitWord(i)),
|
||||
);
|
||||
line = line.push(
|
||||
jl_text_input("Тэги", &word.tags)
|
||||
text_input("Тэги", &word.tags)
|
||||
.size(20)
|
||||
.width(Length::Fill)
|
||||
.on_input(move |string| DictionaryMessage::SetTags(i, string))
|
||||
@@ -389,6 +390,7 @@ impl DictionaryState {
|
||||
col = col.push(line);
|
||||
}
|
||||
|
||||
println!("Words rendering time: {:?}", time.elapsed());
|
||||
scrollable(col).height(Length::Fill).into()
|
||||
}
|
||||
|
||||
@@ -396,7 +398,7 @@ impl DictionaryState {
|
||||
let dict = &self.state.lock().unwrap().dictionary;
|
||||
|
||||
iced::widget::column![
|
||||
jl_text_input("Поиск", &self.search)
|
||||
text_input("Поиск", &self.search)
|
||||
.on_input(DictionaryMessage::Search)
|
||||
.width(Length::Fill),
|
||||
text!("Всего слов: {}", dict.len()),
|
||||
@@ -531,7 +533,7 @@ impl DictionaryState {
|
||||
scrollable(row).width(Length::Fill).horizontal(),
|
||||
row![
|
||||
button("⇳").on_press(ChangeDirection),
|
||||
jl_text_input("Название группы слов", &group.name)
|
||||
text_input("Название группы слов", &group.name)
|
||||
.on_input(EditGroup)
|
||||
.width(250)
|
||||
.on_submit(SaveGroup),
|
||||
|
||||
Reference in New Issue
Block a user