Move all operations to widget::operation module

This commit is contained in:
Héctor Ramón Jiménez 2025-08-23 03:54:54 +02:00
parent 885d45f435
commit 34a42b5ad4
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
14 changed files with 124 additions and 136 deletions

View file

@ -1,7 +1,7 @@
use iced::keyboard;
use iced::widget::{
self, Text, button, center, center_x, checkbox, column, keyed_column, row,
scrollable, text, text_input,
self, Text, button, center, center_x, checkbox, column, keyed_column,
operation, row, scrollable, text, text_input,
};
use iced::window;
use iced::{
@ -91,7 +91,7 @@ impl Todos {
_ => {}
}
text_input::focus("new-task")
operation::focus("new-task")
}
Todos::Loaded(state) => {
let mut saved = false;
@ -132,8 +132,8 @@ impl Todos {
if should_focus {
let id = Task::text_input_id(i);
Command::batch(vec![
text_input::focus(id.clone()),
text_input::select_all(id),
operation::focus(id.clone()),
operation::select_all(id),
])
} else {
Command::none()
@ -150,9 +150,9 @@ impl Todos {
}
Message::TabPressed { shift } => {
if shift {
widget::focus_previous()
operation::focus_previous()
} else {
widget::focus_next()
operation::focus_next()
}
}
Message::ToggleFullscreen(mode) => window::get_latest()