Make Memory::has_focus public (again)
This commit is contained in:
parent
d6de19b507
commit
b187d1c576
2 changed files with 5 additions and 1 deletions
|
@ -11,6 +11,9 @@ NOTE: [`eframe`](eframe/CHANGELOG.md), [`egui_web`](egui_web/CHANGELOG.md) and [
|
|||
* Make labels interactive with `Label::sense(Sense::click())`.
|
||||
* Add `Response::request_focus` and `Response::surrender_focus`.
|
||||
|
||||
### Changed 🔧
|
||||
* Make `Memrory::has_focus` public (again)
|
||||
|
||||
### Fixed 🐛
|
||||
* Fix [defocus-bug on touch screens](https://github.com/emilk/egui/issues/288)
|
||||
|
||||
|
|
|
@ -296,7 +296,8 @@ impl Memory {
|
|||
!self.had_focus_last_frame(id) && self.has_focus(id)
|
||||
}
|
||||
|
||||
pub(crate) fn has_focus(&self, id: Id) -> bool {
|
||||
/// Does this widget have keybaord focus?
|
||||
pub fn has_focus(&self, id: Id) -> bool {
|
||||
self.interaction.focus.id == Some(id)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue