Merge branch 'master' into feature/test-recorder

This commit is contained in:
Héctor Ramón Jiménez 2025-09-11 04:57:17 +02:00
commit a052ce58b0
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
69 changed files with 1555 additions and 833 deletions

View file

@ -6,7 +6,7 @@ use iced::widget::{
use iced::window;
use iced::{
Application, Center, Element, Fill, Font, Function, Preset, Program,
Subscription, Task as Command,
Subscription, Task as Command, Theme,
};
use serde::{Deserialize, Serialize};
@ -156,7 +156,7 @@ impl Todos {
operation::focus_next()
}
}
Message::ToggleFullscreen(mode) => window::get_latest()
Message::ToggleFullscreen(mode) => window::latest()
.and_then(move |window| window::set_mode(window, mode)),
Message::Loaded(_) => Command::none(),
};
@ -199,7 +199,7 @@ impl Todos {
let title = text("todos")
.width(Fill)
.size(100)
.color([0.5, 0.5, 0.5])
.style(subtle)
.align_x(Center);
let input = text_input("What needs to be done?", input_value)
@ -452,7 +452,7 @@ fn empty_message(message: &str) -> Element<'_, Message> {
.width(Fill)
.size(25)
.align_x(Center)
.color([0.7, 0.7, 0.7]),
.style(subtle),
)
.height(200)
.into()
@ -465,6 +465,7 @@ fn icon(unicode: char) -> Text<'static> {
.font(Font::with_name("Iced-Todos-Icons"))
.width(20)
.align_x(Center)
.shaping(text::Shaping::Basic)
}
fn edit_icon() -> Text<'static> {
@ -475,6 +476,12 @@ fn delete_icon() -> Text<'static> {
icon('\u{F1F8}')
}
fn subtle(theme: &Theme) -> text::Style {
text::Style {
color: Some(theme.extended_palette().background.strongest.color),
}
}
// Persistence
#[derive(Debug, Clone, Serialize, Deserialize)]
struct SavedState {
@ -625,6 +632,7 @@ mod tests {
}
#[test]
#[ignore]
fn it_creates_a_new_task() -> Result<(), Error> {
let (mut todos, _command) = Todos::new();
let _command = todos.update(Message::Loaded(Err(LoadError::File)));