fix some button actions missing filters
This commit is contained in:
@@ -48,7 +48,7 @@ pub const BUTTON_EVENTS: [(
|
|||||||
"_press",
|
"_press",
|
||||||
EventListenerKind::MousePress,
|
EventListenerKind::MousePress,
|
||||||
button_any,
|
button_any,
|
||||||
short_duration,
|
ignore_duration,
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"_release",
|
"_release",
|
||||||
@@ -228,7 +228,11 @@ pub(super) fn setup_custom_button<S: 'static>(
|
|||||||
let on_custom_attribs = on_custom_attribs.clone();
|
let on_custom_attribs = on_custom_attribs.clone();
|
||||||
|
|
||||||
Box::new({
|
Box::new({
|
||||||
move |_common, data, _app, _| {
|
move |_common, data, app, _| {
|
||||||
|
if !test_button(data) || !test_duration(&button, app) {
|
||||||
|
return Ok(EventResult::Pass);
|
||||||
|
}
|
||||||
|
|
||||||
context_menu.borrow_mut().open(OpenParams {
|
context_menu.borrow_mut().open(OpenParams {
|
||||||
on_custom_attribs: Some(on_custom_attribs.clone()),
|
on_custom_attribs: Some(on_custom_attribs.clone()),
|
||||||
blueprint: Blueprint::Template {
|
blueprint: Blueprint::Template {
|
||||||
@@ -244,7 +248,11 @@ pub(super) fn setup_custom_button<S: 'static>(
|
|||||||
"::ContextMenuClose" => {
|
"::ContextMenuClose" => {
|
||||||
let context_menu = context_menu.clone();
|
let context_menu = context_menu.clone();
|
||||||
|
|
||||||
Box::new(move |_common, _data, _app, _| {
|
Box::new(move |_common, data, app, _| {
|
||||||
|
if !test_button(data) || !test_duration(&button, app) {
|
||||||
|
return Ok(EventResult::Pass);
|
||||||
|
}
|
||||||
|
|
||||||
context_menu.borrow_mut().close();
|
context_menu.borrow_mut().close();
|
||||||
|
|
||||||
Ok(EventResult::Consumed)
|
Ok(EventResult::Consumed)
|
||||||
@@ -274,7 +282,11 @@ pub(super) fn setup_custom_button<S: 'static>(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Box::new(move |common, _data, _app, _| {
|
Box::new(move |common, data, app, _| {
|
||||||
|
if !test_button(data) || !test_duration(&button, app) {
|
||||||
|
return Ok(EventResult::Pass);
|
||||||
|
}
|
||||||
|
|
||||||
common
|
common
|
||||||
.alterables
|
.alterables
|
||||||
.set_style(widget_id, StyleSetRequest::Display(display));
|
.set_style(widget_id, StyleSetRequest::Display(display));
|
||||||
|
|||||||
Reference in New Issue
Block a user