mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 14:49:06 -04:00
Add Context::text_edit_focused (#8014)
This commit is contained in:
@@ -1933,7 +1933,7 @@ impl Context {
|
||||
}
|
||||
}
|
||||
|
||||
/// Callbacks
|
||||
/// Plugins
|
||||
impl Context {
|
||||
/// Call the given callback at the start of each pass of each viewport.
|
||||
///
|
||||
@@ -2945,6 +2945,15 @@ impl Context {
|
||||
self.egui_wants_keyboard_input()
|
||||
}
|
||||
|
||||
/// Is the currently focused widget a text edit?
|
||||
pub fn text_edit_focused(&self) -> bool {
|
||||
if let Some(id) = self.memory(|mem| mem.focused()) {
|
||||
crate::text_edit::TextEditState::load(self, id).is_some()
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
/// Highlight this widget, to make it look like it is hovered, even if it isn't.
|
||||
///
|
||||
/// If you call this after the widget has been fully rendered,
|
||||
|
||||
Reference in New Issue
Block a user