mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -04:00
Slider event fixes (#1270)
* Slider: return drag_started,dragged,drag_released if value was dragged Closes https://github.com/emilk/egui/issues/1269 * Fix: DragValue correctly reports gained_focus * Make `Slider` report gained_focus,has_focus,lost_focus from DragValue Closes https://github.com/emilk/egui/issues/1268
This commit is contained in:
@@ -510,6 +510,8 @@ impl Response {
|
||||
impl Response {
|
||||
/// A logical "or" operation.
|
||||
/// For instance `a.union(b).hovered` means "was either a or b hovered?".
|
||||
///
|
||||
/// The resulting [`Self::id`] will come from the first (`self`) argument.
|
||||
pub fn union(&self, other: Self) -> Self {
|
||||
assert!(self.ctx == other.ctx);
|
||||
crate::egui_assert!(
|
||||
|
||||
@@ -507,10 +507,10 @@ impl<'a> Slider<'a> {
|
||||
{
|
||||
// Use the `DragValue` id as the id of the whole widget,
|
||||
// so that the focus events work as expected.
|
||||
response = value_response | response;
|
||||
response = value_response.union(response);
|
||||
} else {
|
||||
// Use the slider id as the id for the whole widget
|
||||
response = response | value_response;
|
||||
response = response.union(value_response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user