1
0
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:
Emil Ernerfeldt
2026-03-25 09:21:39 +01:00
committed by GitHub
parent 4feac890aa
commit 2ccc8e8bab

View File

@@ -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,