mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-08 11:55:24 +00:00
dialog: Hosted::if_hovered method
This method allows for the inquiry of the current hovering state, e.g., to suppress an update of the Wifi accesspoint list while the list is hovered. Issue #5008 Issue #5053
This commit is contained in:
parent
fa6c7204cd
commit
1490c58f8b
@ -31,6 +31,7 @@ namespace Dialog {
|
||||
struct Clicked_at;
|
||||
struct Clacked_at;
|
||||
struct Dragged_at;
|
||||
struct Hovered_at;
|
||||
static inline Clicked_at const &clicked_at(At const &at);
|
||||
template <typename...> struct Scope;
|
||||
struct Sub_scope;
|
||||
@ -185,6 +186,7 @@ struct Dialog::At : Noncopyable
|
||||
struct Dialog::Clicked_at : At { using At::At; };
|
||||
struct Dialog::Clacked_at : At { using At::At; };
|
||||
struct Dialog::Dragged_at : At { using At::At; };
|
||||
struct Dialog::Hovered_at : At { using At::At; };
|
||||
|
||||
|
||||
static inline Dialog::Clicked_at const &Dialog::clicked_at(At const &at)
|
||||
@ -372,6 +374,14 @@ struct Dialog::Hosted : Meta::Last<HIERARCHY...>::Type
|
||||
void propagate(Dragged_at const &at, auto &&... args) const {
|
||||
_with_narrowed_at(at, [&] (auto const &at) { this->drag(at, args...); }); }
|
||||
|
||||
bool if_hovered(Hovered_at const &at, auto const &fn) const
|
||||
{
|
||||
bool result = false;
|
||||
_with_narrowed_at(at, [&] (Hovered_at const &at) {
|
||||
result = !at._location.has_type("empty") && fn(at); });
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* \noapi used internally by 'Scope::widget'
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user