From 065c176c4ffc16ba6c7064f9fa5aba466445ff52 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 30 Nov 2024 19:04:32 +0200 Subject: [PATCH] disable apply button on activate to prevent double-click action --- src/app/browser/window/tab/item/identity/gemini/widget.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/browser/window/tab/item/identity/gemini/widget.rs b/src/app/browser/window/tab/item/identity/gemini/widget.rs index f2a787ba..c9f5f30b 100644 --- a/src/app/browser/window/tab/item/identity/gemini/widget.rs +++ b/src/app/browser/window/tab/item/identity/gemini/widget.rs @@ -88,7 +88,13 @@ impl Widget { pub fn on_apply(&self, callback: impl Fn(Value) + 'static) { self.gobject.connect_response(Some(RESPONSE_APPLY.0), { 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()) + } }); }