Rename PlateformSpecific variant in Action to Custom
This commit is contained in:
parent
6e97595d95
commit
2656906903
3 changed files with 10 additions and 5 deletions
|
|
@ -45,8 +45,8 @@ pub enum Action<T> {
|
||||||
tagger: Box<dyn Fn(Result<(), font::Error>) -> T>,
|
tagger: Box<dyn Fn(Result<(), font::Error>) -> T>,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// Pass PlatformSpecific action, for some special platform
|
/// A custom action supported by a specific runtime.
|
||||||
PlatformSpecific(Box<dyn Any>)
|
Custom(Box<dyn Any>),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> Action<T> {
|
impl<T> Action<T> {
|
||||||
|
|
@ -76,7 +76,7 @@ impl<T> Action<T> {
|
||||||
bytes,
|
bytes,
|
||||||
tagger: Box::new(move |result| f(tagger(result))),
|
tagger: Box::new(move |result| f(tagger(result))),
|
||||||
},
|
},
|
||||||
Self::PlatformSpecific(special) => Action::PlatformSpecific(special)
|
Self::Custom(custom) => Action::Custom(custom),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -95,7 +95,7 @@ impl<T> fmt::Debug for Action<T> {
|
||||||
Self::System(action) => write!(f, "Action::System({action:?})"),
|
Self::System(action) => write!(f, "Action::System({action:?})"),
|
||||||
Self::Widget(_action) => write!(f, "Action::Widget"),
|
Self::Widget(_action) => write!(f, "Action::Widget"),
|
||||||
Self::LoadFont { .. } => write!(f, "Action::LoadFont"),
|
Self::LoadFont { .. } => write!(f, "Action::LoadFont"),
|
||||||
Self::PlatformSpecific(_) => write!(f, "Action::PlatformSpecific")
|
Self::Custom(_) => write!(f, "Action::Custom"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -861,7 +861,9 @@ pub fn run_command<A, C, E>(
|
||||||
.send_event(tagger(Ok(())))
|
.send_event(tagger(Ok(())))
|
||||||
.expect("Send message to event loop");
|
.expect("Send message to event loop");
|
||||||
}
|
}
|
||||||
command::Action::PlatformSpecific(_) => unimplemented!(),
|
command::Action::Custom(_) => {
|
||||||
|
log::warn!("Unsupported custom action in `iced_winit` shell");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1127,6 +1127,9 @@ fn run_command<A, C, E>(
|
||||||
.send_event(tagger(Ok(())))
|
.send_event(tagger(Ok(())))
|
||||||
.expect("Send message to event loop");
|
.expect("Send message to event loop");
|
||||||
}
|
}
|
||||||
|
command::Action::Custom(_) => {
|
||||||
|
log::warn!("Unsupported custom action in `iced_winit` shell");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue