Introduce new iced_selector subcrate and refactor Operation
This commit is contained in:
parent
8ca25d627f
commit
63142d34fc
29 changed files with 839 additions and 521 deletions
|
|
@ -349,7 +349,8 @@ mod toast {
|
|||
renderer: &Renderer,
|
||||
operation: &mut dyn Operation,
|
||||
) {
|
||||
operation.container(None, layout.bounds(), &mut |operation| {
|
||||
operation.container(None, layout.bounds());
|
||||
operation.traverse(&mut |operation| {
|
||||
self.content.as_widget().operate(
|
||||
&mut state.children[0],
|
||||
layout,
|
||||
|
|
@ -580,7 +581,8 @@ mod toast {
|
|||
renderer: &Renderer,
|
||||
operation: &mut dyn widget::Operation,
|
||||
) {
|
||||
operation.container(None, layout.bounds(), &mut |operation| {
|
||||
operation.container(None, layout.bounds());
|
||||
operation.traverse(&mut |operation| {
|
||||
self.toasts
|
||||
.iter()
|
||||
.zip(self.state.iter_mut())
|
||||
|
|
|
|||
|
|
@ -613,8 +613,8 @@ fn presets() -> impl Iterator<Item = iced::application::Preset<Todos, Message>>
|
|||
mod tests {
|
||||
use super::*;
|
||||
|
||||
use iced::widget;
|
||||
use iced::{Settings, Theme};
|
||||
use iced_test::selector::id;
|
||||
use iced_test::{Error, Simulator};
|
||||
|
||||
fn simulator(todos: &Todos) -> Simulator<'_, Message> {
|
||||
|
|
@ -633,7 +633,7 @@ mod tests {
|
|||
let _command = todos.update(Message::Loaded(Err(LoadError::File)));
|
||||
|
||||
let mut ui = simulator(&todos);
|
||||
let _input = ui.click(id("new-task"))?;
|
||||
let _input = ui.click(widget::Id::new("new-task"))?;
|
||||
|
||||
let _ = ui.typewrite("Create the universe");
|
||||
let _ = ui.tap_key(keyboard::key::Named::Enter);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue