Before button global styling

This commit is contained in:
2026-08-01 13:04:18 +03:00
parent ce94b01543
commit d9bd1b1b86
16 changed files with 304 additions and 218 deletions
+9 -6
View File
@@ -1,16 +1,19 @@
use crate::data_provider::voice::get_voice;
use crate::lang::{CardSet, CardStatistics, WordData, WordOpenMode};
use crate::repetitions::CardSetSettings;
use crate::Page::PreviousPage;
use crate::{AppState, KeyPressedPage, NavigatedPage, Page, RootMessage, DEFAULT_SPACING};
use crate::{AppState, RootMessage};
use iced::alignment::Horizontal::Center;
use iced::keyboard::key::Physical::Code;
use iced::widget::{button, column, container, row, rule, space, text, Column};
use iced::{alignment, keyboard, Element, Fill, Left, Task};
use iced::{alignment, keyboard, Element, Fill, Left, Task, Theme};
use rodio::MixerDeviceSink;
use std::collections::HashSet;
use std::sync::{Arc, Mutex};
use iced::widget::text::Style;
use tokio::task::spawn_blocking;
use crate::navigation::{KeyPressedPage, NavigatedPage, Page};
use crate::navigation::Page::PreviousPage;
use crate::styling::*;
pub struct RepetitionState {
pub settings: CardSetSettings,
@@ -128,7 +131,7 @@ impl RepetitionState {
container(self.answer_bar())
.width(Fill)
.align_x(Center)
.height(60),
.height(80),
text!(
"Затронуто слов {}, {}%",
self.opened.len(),
@@ -182,12 +185,12 @@ impl RepetitionState {
fn answer_bar(&self) -> Element<'_, RepetitionMessage> {
if !self.open {
return space().into();
return text!("Нажмите Пробел для открытия карточки").style(|theme: &Theme| {Style{ color: Some(theme.palette().text.scale_alpha(0.3)) }}).into();
}
column![
text!("{} очков", self.current_statistic.calculated_score().round() as i32),
row![
button("Не получилось").on_press(RepetitionMessage::Answer(WordOpenMode::None)),
button("Трудно").on_press(RepetitionMessage::Answer(WordOpenMode::Hard)),
button("Нормально").on_press(RepetitionMessage::Answer(WordOpenMode::Ok)),