Implement focus_next operation

... as well as a `count_focusable` composable helper!
This commit is contained in:
Héctor Ramón Jiménez 2022-08-02 04:20:47 +02:00
parent 6dac049db5
commit 77c6864e7c
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
4 changed files with 154 additions and 13 deletions

View file

@ -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())
}