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 DD5F81FF15C for ; Fri, 27 Jun 2025 15:38:22 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6D8671571D; Fri, 27 Jun 2025 15:38:59 +0200 (CEST) Message-ID: <8247d661-7bcb-48d5-9f24-d930fc1c2f1c@proxmox.com> Date: Fri, 27 Jun 2025 15:38:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta To: Shannon Sterz , Yew framework devel list at Proxmox References: <20250627120859.3723554-1-d.csapak@proxmox.com> <20250627120859.3723554-12-d.csapak@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: 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: Re: [yew-devel] [PATCH yew-widget-toolkit 05/11] touch: material app: allow pass through of page animation style 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: yew-devel-bounces@lists.proxmox.com Sender: "yew-devel" On 6/27/25 15:37, Shannon Sterz wrote: > On Fri Jun 27, 2025 at 2:08 PM CEST, Dominik Csapak wrote: >> to the page stack. Otherwise it's impossible to set the animation style >> for a material app. >> >> Signed-off-by: Dominik Csapak >> --- >> src/touch/material_app.rs | 12 ++++++++++-- >> 1 file changed, 10 insertions(+), 2 deletions(-) >> >> diff --git a/src/touch/material_app.rs b/src/touch/material_app.rs >> index d9ea2a0..6d7ac54 100644 >> --- a/src/touch/material_app.rs >> +++ b/src/touch/material_app.rs >> @@ -13,7 +13,7 @@ use pwt_macros::builder; >> >> use crate::prelude::*; >> use crate::state::{NavigationContainer, SharedState, SharedStateObserver}; >> -use crate::touch::{SnackBarController, SnackBarManager}; >> +use crate::touch::{PageAnimationStyle, SnackBarController, SnackBarManager}; >> use crate::widget::{Container, ThemeLoader}; >> >> use super::{PageStack, SideDialog, SideDialogController, SideDialogLocation}; >> @@ -207,6 +207,11 @@ pub struct MaterialApp { >> #[builder(IntoPropValue, into_prop_value)] >> #[prop_or_default] >> pub history: Option, > > could we implement `Default` on `PageAnimationStyle` here and remove the > `Option`? that would also clean up the code below a bit. or is there a > reason not to do that? > sounds good to me, will do in a v2 >> + >> + /// Page animation style used when switching between pages >> + #[builder(IntoPropValue, into_prop_value)] >> + #[prop_or_default] >> + pub page_animation: Option, >> } >> >> impl MaterialApp { >> @@ -372,7 +377,10 @@ impl Component for PwtMaterialApp { >> >> let app = Container::new() >> .class("pwt-viewport") >> - .with_child(PageStack::new(page_stack)) >> + .with_child( >> + PageStack::new(page_stack) >> + .animation_style(props.page_animation.unwrap_or(PageAnimationStyle::Push)), >> + ) >> .with_child( >> SnackBarManager::new() >> .controller(self.snackbar_controller.clone()) > _______________________________________________ yew-devel mailing list yew-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel