Introduce selector flag and decouple iced_widget from iced_runtime

This commit is contained in:
Héctor Ramón Jiménez 2025-08-23 05:15:57 +02:00
parent 34a42b5ad4
commit 81d1eda7fe
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
22 changed files with 118 additions and 67 deletions

View file

@ -12,10 +12,10 @@
pub mod clipboard;
pub mod font;
pub mod keyboard;
pub mod overlay;
pub mod system;
pub mod task;
pub mod user_interface;
pub mod widget;
pub mod window;
pub use iced_core as core;
@ -25,7 +25,6 @@ pub use iced_futures as futures;
pub use task::Task;
pub use user_interface::UserInterface;
use crate::core::widget;
use crate::futures::futures::channel::oneshot;
use std::borrow::Cow;
@ -45,7 +44,7 @@ pub enum Action<T> {
},
/// Run a widget operation.
Widget(Box<dyn widget::Operation>),
Widget(Box<dyn core::widget::Operation>),
/// Run a clipboard action.
Clipboard(clipboard::Action),
@ -67,8 +66,8 @@ pub enum Action<T> {
}
impl<T> Action<T> {
/// Creates a new [`Action::Widget`] with the given [`widget::Operation`].
pub fn widget(operation: impl widget::Operation + 'static) -> Self {
/// Creates a new [`Action::Widget`] with the given [`widget::Operation`](core::widget::Operation).
pub fn widget(operation: impl core::widget::Operation + 'static) -> Self {
Self::Widget(Box::new(operation))
}