dialog: add Sandboxed_runtime::View::if_hovered

Issue #5008
This commit is contained in:
Norman Feske 2023-11-16 13:58:47 +01:00 committed by Christian Helmuth
parent 9fae8a7532
commit 40c0db2e8d

View File

@ -367,6 +367,15 @@ class Dialog::Sandboxed_runtime::View : private Views::Element
~View(); ~View();
void refresh() { _dialog_rom_session.trigger_update(); } void refresh() { _dialog_rom_session.trigger_update(); }
bool if_hovered(auto const &fn) const
{
bool result = false;
if (_dialog_hovered)
_with_dialog_hover([&] (Xml_node const &location) {
result = fn(Hovered_at { Event::Seq_number { }, location }); });
return result;
}
}; };