* [yew-devel] [PATCH yew-widget-toolkit] touch: side dialog: rename 'direction' to 'location'
@ 2025-07-01 6:57 Dominik Csapak
2025-07-01 9:25 ` [yew-devel] applied: " Dietmar Maurer
0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2025-07-01 6:57 UTC (permalink / raw)
To: 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 <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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [yew-devel] applied: [PATCH yew-widget-toolkit] touch: side dialog: rename 'direction' to 'location'
2025-07-01 6:57 [yew-devel] [PATCH yew-widget-toolkit] touch: side dialog: rename 'direction' to 'location' Dominik Csapak
@ 2025-07-01 9:25 ` Dietmar Maurer
0 siblings, 0 replies; 2+ messages in thread
From: Dietmar Maurer @ 2025-07-01 9:25 UTC (permalink / raw)
To: Yew framework devel list at Proxmox, Dominik Csapak
applied
_______________________________________________
yew-devel mailing list
yew-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-01 9:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-01 6:57 [yew-devel] [PATCH yew-widget-toolkit] touch: side dialog: rename 'direction' to 'location' Dominik Csapak
2025-07-01 9:25 ` [yew-devel] applied: " Dietmar Maurer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal