public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pmg-devel@lists.proxmox.com, yew-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH yew-widget-toolkit 1/1] touch: material app: add option for the theme dir prefix
Date: Thu, 10 Jul 2025 12:28:12 +0200	[thread overview]
Message-ID: <20250710102812.2480856-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250710102812.2480856-1-d.csapak@proxmox.com>

otherwise we can't use different paths for the css/font files when using
a material app.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/touch/material_app.rs | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/touch/material_app.rs b/src/touch/material_app.rs
index 2c72e00..079dd5c 100644
--- a/src/touch/material_app.rs
+++ b/src/touch/material_app.rs
@@ -212,6 +212,11 @@ pub struct MaterialApp {
     #[builder(IntoPropValue, into_prop_value)]
     #[prop_or(Some(PageAnimationStyle::FadeFromRight))]
     pub page_animation: Option<PageAnimationStyle>,
+
+    #[builder]
+    #[prop_or_default]
+    /// The directory prefix for the css files. (E.g. "/css/")
+    pub theme_dir_prefix: AttrValue,
 }
 
 impl MaterialApp {
@@ -385,11 +390,14 @@ impl Component for PwtMaterialApp {
             )
             .with_optional_child(self.dialog.as_ref().map(|(_, dialog)| dialog.clone()));
 
+        let theme_loader = ThemeLoader::new(NavigationContainer::new().with_child(app))
+            .dir_prefix(props.theme_dir_prefix.clone());
+
         html! {
             <Router history={self.history.clone()} basename={props.basename.clone()}>
                 <ContextProvider<SnackBarController> context={self.snackbar_controller.clone()}>
                     <ContextProvider<PageController> context={self.page_controller.clone()}>
-                    { ThemeLoader::new(NavigationContainer::new().with_child(app))}
+                    { theme_loader }
                     </ContextProvider<PageController>>
                 </ContextProvider<SnackBarController>>
             </Router>
-- 
2.39.5



_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel


      parent reply	other threads:[~2025-07-10 10:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-10 10:28 [pmg-devel] [PATCH http-server/yew-widget-toolkit 0/2] prepare change to mobile quarantine ui Dominik Csapak
2025-07-10 10:28 ` [pmg-devel] [PATCH http-server 1/1] api server: add 'wasm' as valid extension Dominik Csapak
2025-07-15 19:29   ` [pmg-devel] applied: [yew-devel] " Thomas Lamprecht
2025-07-10 10:28 ` Dominik Csapak [this message]

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=20250710102812.2480856-3-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pmg-devel@lists.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 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