From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id C8BA91FF16B for ; Tue, 1 Jul 2025 08:57:08 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A1DB037F96; Tue, 1 Jul 2025 08:57:47 +0200 (CEST) From: Dominik Csapak To: yew-devel@lists.proxmox.com Date: Tue, 1 Jul 2025 08:57:14 +0200 Message-Id: <20250701065714.280624-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.097 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.237 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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] touch: side dialog: rename 'direction' to 'location' 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" The type is a SideDialogLocation, so it's not a direction. Renaming the property (and the methods automatically) to 'location' fixes that inconsistency. Signed-off-by: Dominik Csapak --- src/touch/material_app.rs | 6 +++--- src/touch/side_dialog.rs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/touch/material_app.rs b/src/touch/material_app.rs index 271fb25..c8185c5 100644 --- a/src/touch/material_app.rs +++ b/src/touch/material_app.rs @@ -76,7 +76,7 @@ impl PageController { pub fn show_drawer(&self, drawer: impl Into) { self.show_side_dialog( SideDialog::new() - .direction(SideDialogLocation::Left) + .location(SideDialogLocation::Left) .with_child(drawer.into()), ); } @@ -87,7 +87,7 @@ impl PageController { pub fn show_end_drawer(&self, drawer: impl Into) { self.show_side_dialog( SideDialog::new() - .direction(SideDialogLocation::Right) + .location(SideDialogLocation::Right) .with_child(drawer.into()), ); } @@ -98,7 +98,7 @@ impl PageController { pub fn show_modal_bottom_sheet(&self, bottom_sheet: impl Into) { self.show_side_dialog( SideDialog::new() - .direction(SideDialogLocation::Bottom) + .location(SideDialogLocation::Bottom) .with_child(bottom_sheet.into()), ); } diff --git a/src/touch/side_dialog.rs b/src/touch/side_dialog.rs index 01abcd9..6c15796 100644 --- a/src/touch/side_dialog.rs +++ b/src/touch/side_dialog.rs @@ -86,7 +86,7 @@ pub struct SideDialog { #[prop_or(SideDialogLocation::Left)] #[builder] - pub direction: SideDialogLocation, + pub location: SideDialogLocation, } impl ContainerBuilder for SideDialog { @@ -274,7 +274,7 @@ impl Component for PwtSideDialog { let mut dismiss = false; let threshold = 100.0; if let Some((delta_x, delta_y)) = self.drag_delta { - dismiss = match props.direction { + dismiss = match props.location { SideDialogLocation::Left => delta_x < -threshold, SideDialogLocation::Right => delta_x > threshold, SideDialogLocation::Top => delta_y < -threshold, @@ -300,7 +300,7 @@ impl Component for PwtSideDialog { } Msg::Swipe(event) => { let angle = event.direction; // -180 to + 180 - let dismiss = match props.direction { + let dismiss = match props.location { SideDialogLocation::Left => !(-135.0..=135.0).contains(&angle), SideDialogLocation::Right => angle > -45.0 && angle < 45.0, SideDialogLocation::Top => angle > 45.0 && angle < 135.0, @@ -338,7 +338,7 @@ impl Component for PwtSideDialog { SliderState::Visible | SliderState::SlideIn => "visible", }; - let slider_direction_class = match props.direction { + let slider_direction_class = match props.location { SideDialogLocation::Left => "pwt-side-dialog-left", SideDialogLocation::Right => "pwt-side-dialog-right", SideDialogLocation::Top => "pwt-side-dialog-top", @@ -349,7 +349,7 @@ impl Component for PwtSideDialog { let mut transition = None; if let Some((delta_x, delta_y)) = self.drag_delta { transition = Some("none"); - match props.direction { + match props.location { SideDialogLocation::Left => { let delta_x = delta_x.min(0.0); transform = Some(format!("translateX({delta_x}px)")); -- 2.39.5 _______________________________________________ yew-devel mailing list yew-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel