Fix pick_list not requesting a redraw when open
This commit is contained in:
parent
fec75221f9
commit
03bffe3db6
1 changed files with 15 additions and 8 deletions
|
|
@ -518,12 +518,16 @@ where
|
||||||
_ => {}
|
_ => {}
|
||||||
};
|
};
|
||||||
|
|
||||||
let status = if state.is_open {
|
let status = {
|
||||||
Status::Opened
|
let is_hovered = cursor.is_over(layout.bounds());
|
||||||
} else if cursor.is_over(layout.bounds()) {
|
|
||||||
Status::Hovered
|
if state.is_open {
|
||||||
} else {
|
Status::Opened { is_hovered }
|
||||||
Status::Active
|
} else if is_hovered {
|
||||||
|
Status::Hovered
|
||||||
|
} else {
|
||||||
|
Status::Active
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Event::Window(window::Event::RedrawRequested(_now)) = event {
|
if let Event::Window(window::Event::RedrawRequested(_now)) = event {
|
||||||
|
|
@ -824,7 +828,10 @@ pub enum Status {
|
||||||
/// The [`PickList`] is being hovered.
|
/// The [`PickList`] is being hovered.
|
||||||
Hovered,
|
Hovered,
|
||||||
/// The [`PickList`] is open.
|
/// The [`PickList`] is open.
|
||||||
Opened,
|
Opened {
|
||||||
|
/// Whether the [`PickList`] is hovered, while open.
|
||||||
|
is_hovered: bool,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The appearance of a pick list.
|
/// The appearance of a pick list.
|
||||||
|
|
@ -898,7 +905,7 @@ pub fn default(theme: &Theme, status: Status) -> Style {
|
||||||
|
|
||||||
match status {
|
match status {
|
||||||
Status::Active => active,
|
Status::Active => active,
|
||||||
Status::Hovered | Status::Opened => Style {
|
Status::Hovered | Status::Opened { .. } => Style {
|
||||||
border: Border {
|
border: Border {
|
||||||
color: palette.primary.strong.color,
|
color: palette.primary.strong.color,
|
||||||
..active.border
|
..active.border
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue