MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / focused_element

Method focused_element

src/engine.rs:5775–5783  ·  view source on GitHub ↗

Returns the currently focused element's ID, or None.

(&self)

Source from the content-addressed store, hash-verified

5773
5774 /// Returns the currently focused element's ID, or None.
5775 pub fn focused_element(&self) -> Option<Id> {
5776 if self.focused_element_id != 0 {
5777 self.layout_element_map
5778 .get(&self.focused_element_id)
5779 .map(|item| item.element_id.clone())
5780 } else {
5781 None
5782 }
5783 }
5784
5785 /// Sets focus to the element with the given ID, firing on_unfocus/on_focus callbacks.
5786 pub fn set_focus(&mut self, element_id: u32) {

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
cloneMethod · 0.80

Tested by

no test coverage detected