Post mouseover callback when ui::selector is removed from it's parent
This commit is contained in:
parent
e05a28463d
commit
945b126e64
2 changed files with 10 additions and 0 deletions
|
|
@ -14,6 +14,8 @@ namespace psemek::ui
|
|||
selector();
|
||||
~selector() override;
|
||||
|
||||
void set_parent(element * parent) override;
|
||||
|
||||
children_range children() const override { return children_range_; }
|
||||
|
||||
struct shape const & shape() const override { return shape_; }
|
||||
|
|
|
|||
|
|
@ -21,6 +21,14 @@ namespace psemek::ui
|
|||
release_children();
|
||||
}
|
||||
|
||||
void selector::set_parent(element * parent)
|
||||
{
|
||||
if (!parent && mouseover_callback_)
|
||||
post([cb = mouseover_callback_]{ cb(std::nullopt); });
|
||||
|
||||
element::set_parent(parent);
|
||||
}
|
||||
|
||||
void selector::reshape(geom::box<float, 2> const & box)
|
||||
{
|
||||
shape_.box = box;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue