fix internal events blocking custom events on the same widget
This commit is contained in:
@@ -2,10 +2,11 @@ use std::{
|
|||||||
any::{Any, TypeId},
|
any::{Any, TypeId},
|
||||||
cell::RefMut,
|
cell::RefMut,
|
||||||
collections::HashSet,
|
collections::HashSet,
|
||||||
|
ops::Deref,
|
||||||
};
|
};
|
||||||
|
|
||||||
use glam::Vec2;
|
use glam::Vec2;
|
||||||
use slotmap::{DenseSlotMap, new_key_type};
|
use slotmap::{new_key_type, DenseSlotMap};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
animation::{self, Animation},
|
animation::{self, Animation},
|
||||||
@@ -184,7 +185,7 @@ impl CallbackMetadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub enum EventListenerKind {
|
pub enum EventListenerKind {
|
||||||
MousePress,
|
MousePress,
|
||||||
MouseRelease,
|
MouseRelease,
|
||||||
|
|||||||
@@ -264,9 +264,6 @@ impl WidgetState {
|
|||||||
// Consider all listeners on this widget, even if we had a Consume.
|
// Consider all listeners on this widget, even if we had a Consume.
|
||||||
// Store the highest value for return.
|
// Store the highest value for return.
|
||||||
*call_data.event_result = call_data.event_result.merge(new_result);
|
*call_data.event_result = call_data.event_result.merge(new_result);
|
||||||
if !call_data.event_result.can_propagate() {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,8 @@ pub(super) fn setup_custom_button<S: 'static>(
|
|||||||
_ => return,
|
_ => return,
|
||||||
};
|
};
|
||||||
|
|
||||||
layout.add_event_listener(attribs.widget_id, *kind, callback);
|
let id = layout.add_event_listener(attribs.widget_id, *kind, callback);
|
||||||
|
log::debug!("Registered {action} on {:?} as {id:?}", attribs.widget_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
struct ShellButtonMutableState {
|
struct ShellButtonMutableState {
|
||||||
|
|||||||
Reference in New Issue
Block a user