From 60ddae66eaabf60ec5cf9f86962267a83ca1491c Mon Sep 17 00:00:00 2001 From: Dmitry Stepanov Date: Sun, 10 Nov 2024 13:30:18 +0300 Subject: [PATCH] focus search bar's text box when focusing toolbar itself - toolbar focus makes no sense anyway, because it does not interact with keyboard, but text box does --- fyrox-ui/src/searchbar.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fyrox-ui/src/searchbar.rs b/fyrox-ui/src/searchbar.rs index 6c05d7d0d..d41fc0ef9 100644 --- a/fyrox-ui/src/searchbar.rs +++ b/fyrox-ui/src/searchbar.rs @@ -24,6 +24,7 @@ #![warn(missing_docs)] +use crate::widget::WidgetMessage; use crate::{ border::BorderBuilder, brush::Brush, @@ -121,6 +122,11 @@ impl Control for SearchBar { MessageDirection::ToWidget, text.clone(), )); + } else if let Some(WidgetMessage::Focus) = message.data() { + ui.send_message(WidgetMessage::focus( + *self.text_box, + MessageDirection::ToWidget, + )); } }