diff options
author | 2023-02-16 14:32:59 +0100 | |
---|---|---|
committer | 2023-04-11 05:11:23 +0200 | |
commit | d24a4a46895ed711ddfc3199a0445f0b69a812e4 (patch) | |
tree | d18477c286585f14334a2ae591e81f7ce86fee05 /examples | |
parent | bfc5db9009f10a67ed277ce9d1997bcdea3f6acd (diff) | |
download | iced-d24a4a46895ed711ddfc3199a0445f0b69a812e4.tar.gz iced-d24a4a46895ed711ddfc3199a0445f0b69a812e4.tar.bz2 iced-d24a4a46895ed711ddfc3199a0445f0b69a812e4.zip |
Changed `Handle` to `Icon` to be consistent
Diffstat (limited to 'examples')
-rw-r--r-- | examples/text_input/src/main.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/text_input/src/main.rs b/examples/text_input/src/main.rs index b25ed7e1..e0ba1983 100644 --- a/examples/text_input/src/main.rs +++ b/examples/text_input/src/main.rs @@ -13,13 +13,13 @@ pub fn main() -> iced::Result { #[derive(Default)] struct Example { value: String, - is_showing_handle: bool, + is_showing_icon: bool, } #[derive(Debug, Clone)] enum Message { Changed(String), - ToggleHandle(bool), + ToggleIcon(bool), } impl Sandbox for Example { @@ -36,27 +36,27 @@ impl Sandbox for Example { fn update(&mut self, message: Message) { match message { Message::Changed(value) => self.value = value, - Message::ToggleHandle(_) => { - self.is_showing_handle = !self.is_showing_handle + Message::ToggleIcon(_) => { + self.is_showing_icon = !self.is_showing_icon } } } fn view(&self) -> Element<Message> { let checkbox = - checkbox("Handle", self.is_showing_handle, Message::ToggleHandle) + checkbox("Icon", self.is_showing_icon, Message::ToggleIcon) .spacing(5) .text_size(16); let mut text_input = text_input("Placeholder", self.value.as_str(), Message::Changed); - if self.is_showing_handle { - text_input = text_input.handle(text_input::Handle { + if self.is_showing_icon { + text_input = text_input.icon(text_input::Icon { font: ICON_FONT, - text: String::from('\u{e900}'), + code_point: '\u{e900}', size: Some(18), - position: text_input::HandlePosition::Right, + position: text_input::IconPosition::Right, }); } |