From 52f84e51e90db1c324310565f2aff8b7e6987cba Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 28 Jul 2022 03:53:47 +0200 Subject: Implement `Widget::operate` for `TextInput` --- src/widget.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/widget.rs') diff --git a/src/widget.rs b/src/widget.rs index 4ddf0566..abffadd5 100644 --- a/src/widget.rs +++ b/src/widget.rs @@ -119,7 +119,9 @@ pub mod toggler { pub mod text_input { //! Display fields that can be filled with text. - pub use iced_native::widget::text_input::{Appearance, StyleSheet}; + pub use iced_native::widget::text_input::{ + focus, Appearance, Id, StyleSheet, + }; /// A field that can be filled with text. pub type TextInput<'a, Message, Renderer = crate::Renderer> = -- cgit From 77c6864e7c772c5e228bc09fe40c2c0b8884386d Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 2 Aug 2022 04:20:47 +0200 Subject: Implement `focus_next` operation ... as well as a `count_focusable` composable helper! --- src/widget.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/widget.rs') 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() -> Command +where + Message: 'static, +{ + Command::widget(operation::focus_next()) +} -- cgit From 6eb3dd7e5edc8847875c288c41d1dec8b1dad06e Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 4 Aug 2022 03:24:44 +0200 Subject: Implement `focus_previous` operation --- src/widget.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/widget.rs') diff --git a/src/widget.rs b/src/widget.rs index 2333aa28..c3b6d83b 100644 --- a/src/widget.rs +++ b/src/widget.rs @@ -215,6 +215,14 @@ pub use svg::Svg; use crate::Command; use iced_native::widget::operation; +/// Focuses the previous focusable widget. +pub fn focus_previous() -> Command +where + Message: 'static, +{ + Command::widget(operation::focus_previous()) +} + /// Focuses the next focusable widget. pub fn focus_next() -> Command where -- cgit From 13dd1ca0a83cc95eea52e2106da9dc1ee1f37958 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 4 Aug 2022 03:55:41 +0200 Subject: Implement `scrollable::snap_to` operation --- src/widget.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/widget.rs') diff --git a/src/widget.rs b/src/widget.rs index c3b6d83b..817d2d33 100644 --- a/src/widget.rs +++ b/src/widget.rs @@ -99,7 +99,7 @@ pub mod radio { pub mod scrollable { //! Navigate an endless amount of content with a scrollbar. pub use iced_native::widget::scrollable::{ - style::Scrollbar, style::Scroller, StyleSheet, + snap_to, style::Scrollbar, style::Scroller, Id, StyleSheet, }; /// A widget that can vertically display an infinite amount of content @@ -220,7 +220,7 @@ pub fn focus_previous() -> Command where Message: 'static, { - Command::widget(operation::focus_previous()) + Command::widget(operation::focusable::focus_previous()) } /// Focuses the next focusable widget. @@ -228,5 +228,5 @@ pub fn focus_next() -> Command where Message: 'static, { - Command::widget(operation::focus_next()) + Command::widget(operation::focusable::focus_next()) } -- cgit