Invalidate layout when Tooltip changes overlay
This commit is contained in:
parent
7dd32f3be4
commit
f67387f2d8
1 changed files with 9 additions and 1 deletions
|
|
@ -157,11 +157,19 @@ where
|
|||
) -> event::Status {
|
||||
let state = tree.state.downcast_mut::<State>();
|
||||
|
||||
let was_idle = *state == State::Idle;
|
||||
|
||||
*state = cursor
|
||||
.position_over(layout.bounds())
|
||||
.map(|cursor_position| State::Hovered { cursor_position })
|
||||
.unwrap_or_default();
|
||||
|
||||
let is_idle = *state == State::Idle;
|
||||
|
||||
if was_idle != is_idle {
|
||||
shell.invalidate_layout();
|
||||
}
|
||||
|
||||
self.content.as_widget_mut().on_event(
|
||||
&mut tree.children[0],
|
||||
event,
|
||||
|
|
@ -289,7 +297,7 @@ pub enum Position {
|
|||
Right,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Default)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Default)]
|
||||
enum State {
|
||||
#[default]
|
||||
Idle,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue