fix: request redraw if hovered state changes in segmented_button
This commit is contained in:
parent
030a7dbe02
commit
633e6ab83f
1 changed files with 7 additions and 1 deletions
|
|
@ -1244,6 +1244,8 @@ where
|
|||
let my_bounds = layout.bounds();
|
||||
let state = tree.state.downcast_mut::<LocalState>();
|
||||
|
||||
let hovered_before = state.hovered;
|
||||
|
||||
let my_id = self.get_drag_id();
|
||||
|
||||
if let Event::Dnd(e) = &mut event {
|
||||
|
|
@ -1916,6 +1918,10 @@ where
|
|||
shell.capture_event();
|
||||
}
|
||||
}
|
||||
|
||||
if hovered_before != state.hovered {
|
||||
shell.request_redraw();
|
||||
}
|
||||
}
|
||||
|
||||
fn operate(
|
||||
|
|
@ -2764,7 +2770,7 @@ pub struct LocalState {
|
|||
drop_hint: Option<DropHint>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq)]
|
||||
enum Item {
|
||||
NextButton,
|
||||
#[default]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue