From 15984b78dbac9c6935b564b2579bfcc1b2fd99b4 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Tue, 14 Nov 2023 15:53:11 -0600 Subject: [PATCH] use the name in the dioxus.toml in desktop if no name was set in the desktop config --- packages/desktop/Cargo.toml | 1 + packages/desktop/src/cfg.rs | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/desktop/Cargo.toml b/packages/desktop/Cargo.toml index dcb994120..24c938c01 100644 --- a/packages/desktop/Cargo.toml +++ b/packages/desktop/Cargo.toml @@ -14,6 +14,7 @@ dioxus-core = { workspace = true, features = ["serialize"] } dioxus-html = { workspace = true, features = ["serialize", "native-bind"] } dioxus-interpreter-js = { workspace = true } dioxus-hot-reload = { workspace = true, optional = true } +dioxus-cli-config = { workspace = true } serde = "1.0.136" serde_json = "1.0.79" diff --git a/packages/desktop/src/cfg.rs b/packages/desktop/src/cfg.rs index 07281e364..a2dad21c5 100644 --- a/packages/desktop/src/cfg.rs +++ b/packages/desktop/src/cfg.rs @@ -49,7 +49,12 @@ impl Config { /// Initializes a new `WindowBuilder` with default values. #[inline] pub fn new() -> Self { - let window = WindowBuilder::new().with_title("Dioxus app"); + let window = WindowBuilder::new().with_title( + dioxus_cli_config::CURRENT_CONFIG + .as_ref() + .map(|c| c.dioxus_config.application.name.clone()) + .unwrap_or("Dioxus App".to_string()), + ); Self { // event_handler: None,