From: Dominik Csapak <d.csapak@proxmox.com>
To: yew-devel@lists.proxmox.com
Subject: [yew-devel] [PATCH yew-widget-toolkit] touch: side dialog: rename 'direction' to 'location'
Date: Tue, 1 Jul 2025 08:57:14 +0200 [thread overview]
Message-ID: <20250701065714.280624-1-d.csapak@proxmox.com> (raw)
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 <d.csapak@proxmox.com>
---
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<VNode>) {
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<VNode>) {
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<VNode>) {
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
next reply other threads:[~2025-07-01 6:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-01 6:57 Dominik Csapak [this message]
2025-07-01 9:25 ` [yew-devel] applied: " Dietmar Maurer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250701065714.280624-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=yew-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.