mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
Add Context::text_edit_focused (#8014)
This commit is contained in:
@@ -1933,7 +1933,7 @@ impl Context {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Callbacks
|
/// Plugins
|
||||||
impl Context {
|
impl Context {
|
||||||
/// Call the given callback at the start of each pass of each viewport.
|
/// Call the given callback at the start of each pass of each viewport.
|
||||||
///
|
///
|
||||||
@@ -2945,6 +2945,15 @@ impl Context {
|
|||||||
self.egui_wants_keyboard_input()
|
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.
|
/// 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,
|
/// If you call this after the widget has been fully rendered,
|
||||||
|
|||||||
Reference in New Issue
Block a user