mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
disable apply button on activate to prevent double-click action
This commit is contained in:
parent
c4b9fdebf2
commit
065c176c4f
@ -88,7 +88,13 @@ impl Widget {
|
|||||||
pub fn on_apply(&self, callback: impl Fn(Value) + 'static) {
|
pub fn on_apply(&self, callback: impl Fn(Value) + 'static) {
|
||||||
self.gobject.connect_response(Some(RESPONSE_APPLY.0), {
|
self.gobject.connect_response(Some(RESPONSE_APPLY.0), {
|
||||||
let form = self.form.clone();
|
let form = self.form.clone();
|
||||||
move |_, _| callback(form.list.selected())
|
move |this, _| {
|
||||||
|
// Prevent double-click action
|
||||||
|
this.set_response_enabled(RESPONSE_APPLY.0, false);
|
||||||
|
|
||||||
|
// Result
|
||||||
|
callback(form.list.selected())
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user