mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
disable apply button on activate to prevent double-click action
This commit is contained in:
parent
c4b9fdebf2
commit
065c176c4f
1 changed files with 7 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue