From 21bc19e893db6fc6176904650c65ee0b714b89eb Mon Sep 17 00:00:00 2001 From: doryan Date: Sat, 17 Aug 2024 21:51:09 +0400 Subject: [PATCH] fix(path): add paths for debug and release profiles --- src/view/components/dialogues.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/view/components/dialogues.rs b/src/view/components/dialogues.rs index c499e8a..fabeb72 100644 --- a/src/view/components/dialogues.rs +++ b/src/view/components/dialogues.rs @@ -11,10 +11,14 @@ use std::path::Path; use crate::view::properties::Setters; +#[cfg(debug_assertions)] +const PATH: &str = "./src/view/resources/logo.png"; + +#[cfg(not(debug_assertions))] +const PATH: &str = "./resources/logo.png"; + pub fn open_about_dialogue(_action: &SimpleAction, _var: Option<&Variant>) { - let logo = Image::from_file(Path::new("./src/view/resources/logo.png")) - .paintable() - .unwrap(); + let logo = Image::from_file(Path::new(PATH)).paintable().unwrap(); AboutDialog::builder() .authors(vec!["Сагиев А.Д.", "Ефимов И.П."])