More styling

This commit is contained in:
2026-08-01 19:36:43 +03:00
parent 9a1d68aac1
commit 42d0488f23
13 changed files with 295 additions and 253 deletions
+19 -21
View File
@@ -1,18 +1,17 @@
use crate::data_provider::history::{HistoryItem, get_history_of_set};
use crate::data_provider::history::{get_history_of_set, HistoryItem};
use crate::lang::WordData;
use crate::navigation::{NavigatedPage, Page};
use crate::styling::*;
use crate::{AppState, RootMessage};
use HistoryMessage::Back;
use iced::alignment::Horizontal::Center;
use iced::widget::space::horizontal;
use iced::widget::*;
use iced::{Element, Fill, FillPortion, Left, Task};
use iced::{Element, Fill, FillPortion, Task};
use std::sync::{Arc, Mutex};
use crate::navigation::{NavigatedPage, Page};
use crate::styling::*;
use HistoryMessage::Back;
#[derive(Clone)]
pub struct HistoryState {
set_id: u32,
list: Vec<HistoryItem>,
words: Vec<WordData>,
}
@@ -21,7 +20,6 @@ impl NavigatedPage<HistoryMessage> for HistoryState {
fn navigate(&self, message: &HistoryMessage) -> Option<Page> {
match message {
Back => Some(Page::PreviousPage),
_ => None,
}
}
}
@@ -43,7 +41,6 @@ impl HistoryState {
.collect();
Self {
set_id: id,
list: history,
words,
}
@@ -54,25 +51,26 @@ impl HistoryState {
}
pub fn view(&self) -> Element<'_, HistoryMessage> {
container(
iced::widget::column![
button("Назад").style(jl_button).on_press(Back),
iced::widget::row![
back_overlay(iced::widget::row![
horizontal().width(FillPortion(1)),
scrollable(self.history_lines().padding(DEFAULT_SPACING))
.height(Fill)
.width(FillPortion(5)),
horizontal().width(FillPortion(1))
]
.height(Fill)
.width(Fill)
]
.align_x(Left)
.width(Fill),
)
.center_x(Fill)
.padding(10)
.into()
.height(Fill)
.width(Fill).into(), Back)
// container(
// iced::widget::column![
// button("Назад").style(jl_button).on_press(Back),
//
// ]
// .align_x(Left)
// .width(Fill),
// )
// .center_x(Fill)
// .padding(10)
// .into()
}
fn history_lines(&self) -> Column<'_, HistoryMessage> {