diff options
author | 2022-08-02 04:20:47 +0200 | |
---|---|---|
committer | 2022-08-02 04:20:47 +0200 | |
commit | 77c6864e7c772c5e228bc09fe40c2c0b8884386d (patch) | |
tree | bad8540154db00567937a2e357e3bd271b509f23 /src | |
parent | 6dac049db5824e3af06bc16df0fdf51f8809aeb4 (diff) | |
download | iced-77c6864e7c772c5e228bc09fe40c2c0b8884386d.tar.gz iced-77c6864e7c772c5e228bc09fe40c2c0b8884386d.tar.bz2 iced-77c6864e7c772c5e228bc09fe40c2c0b8884386d.zip |
Implement `focus_next` operation
... as well as a `count_focusable` composable helper!
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 6 | ||||
-rw-r--r-- | src/widget.rs | 11 |
2 files changed, 16 insertions, 1 deletions
@@ -192,22 +192,26 @@ use iced_wgpu as renderer; use iced_glow as renderer; pub use iced_native::theme; +pub use runtime::event; +pub use runtime::subscription; pub use application::Application; pub use element::Element; pub use error::Error; +pub use event::Event; pub use executor::Executor; pub use renderer::Renderer; pub use result::Result; pub use sandbox::Sandbox; pub use settings::Settings; +pub use subscription::Subscription; pub use theme::Theme; pub use runtime::alignment; pub use runtime::futures; pub use runtime::{ Alignment, Background, Color, Command, ContentFit, Font, Length, Padding, - Point, Rectangle, Size, Subscription, Vector, + Point, Rectangle, Size, Vector, }; #[cfg(feature = "system")] diff --git a/src/widget.rs b/src/widget.rs index abffadd5..2333aa28 100644 --- a/src/widget.rs +++ b/src/widget.rs @@ -211,3 +211,14 @@ pub use qr_code::QRCode; #[cfg(feature = "svg")] #[cfg_attr(docsrs, doc(cfg(feature = "svg")))] pub use svg::Svg; + +use crate::Command; +use iced_native::widget::operation; + +/// Focuses the next focusable widget. +pub fn focus_next<Message>() -> Command<Message> +where + Message: 'static, +{ + Command::widget(operation::focus_next()) +} |