From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id BB2BA1FF16F for ; Tue, 24 Jun 2025 14:19:25 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 10D56368D9; Tue, 24 Jun 2025 14:20:00 +0200 (CEST) From: Dominik Csapak To: yew-devel@lists.proxmox.com Date: Tue, 24 Jun 2025 14:19:22 +0200 Message-Id: <20250624121925.57056-9-d.csapak@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250624121925.57056-1-d.csapak@proxmox.com> References: <20250624121925.57056-1-d.csapak@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.022 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [yew-devel] [PATCH yew-widget-toolkit 4/7] touch: slidable action: rename on_click to on_activate X-BeenThere: yew-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Yew framework devel list at Proxmox List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Yew framework devel list at Proxmox Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: yew-devel-bounces@lists.proxmox.com Sender: "yew-devel" to be consistent with buttons, etc. Signed-off-by: Dominik Csapak --- src/touch/slidable/slidable_action.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/touch/slidable/slidable_action.rs b/src/touch/slidable/slidable_action.rs index 263ae0e..de37445 100644 --- a/src/touch/slidable/slidable_action.rs +++ b/src/touch/slidable/slidable_action.rs @@ -11,7 +11,7 @@ use super::{SlidableActionMouseEvent, SlidableController}; /// A button which automatically connects to the [SlidableController]. /// -/// The [on_click](Self::on_click) handler gets an [SlidableActionMouseEvent] argument, +/// The [on_activate](Self::on_activate) handler gets an [SlidableActionMouseEvent] argument, /// which lets you collapse or dismiss the slidable. #[derive(Properties, Clone, PartialEq)] pub struct SlidableAction { @@ -30,7 +30,7 @@ pub struct SlidableAction { /// /// Emited when the user clicks on the entry. #[prop_or_default] - pub on_click: Option>, + pub on_activate: Option>, } impl SlidableAction { @@ -51,9 +51,9 @@ impl SlidableAction { self.icon_class = Some(icon_class.into()); } - /// Builder style method to set the on_click callback. - pub fn on_click(mut self, cb: impl IntoEventCallback) -> Self { - self.on_click = cb.into_event_callback(); + /// Builder style method to set the on_activate callback. + pub fn on_activate(mut self, cb: impl IntoEventCallback) -> Self { + self.on_activate = cb.into_event_callback(); self } } @@ -102,11 +102,11 @@ impl Component for PwtSlidableAction { let onclick = Callback::from({ let controller = self.controller.clone(); - let on_click = props.on_click.clone(); + let on_activate = props.on_activate.clone(); move |event: MouseEvent| { - if let Some(on_click) = &on_click { + if let Some(on_activate) = &on_activate { let event = SlidableActionMouseEvent::new(event); - on_click.emit(event.clone()); + on_activate.emit(event.clone()); if let Some(controller) = &controller { if event.get_dismiss() { controller.dismiss(); @@ -115,7 +115,7 @@ impl Component for PwtSlidableAction { } } } else { - // Always collabse if action is without on_click callback + // Always collapse if action is without on_activate callback if let Some(controller) = &controller { controller.collapse(); } -- 2.39.5 _______________________________________________ yew-devel mailing list yew-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel