Rename window_icon to icon

This commit is contained in:
Tim-Paik 2022-05-01 16:55:49 +08:00
parent eb5eb5283a
commit 1315bbab3d
Signed by: Tim-Paik
GPG Key ID: DC36A050DB42566D
3 changed files with 7 additions and 7 deletions

View File

@ -62,7 +62,7 @@ pub struct Config {
pub transparent: bool, pub transparent: bool,
pub decorations: bool, pub decorations: bool,
pub always_on_top: bool, pub always_on_top: bool,
pub window_icon: Option<PathBuf>, pub icon: Option<PathBuf>,
pub spa: bool, pub spa: bool,
pub url: Option<String>, pub url: Option<String>,
pub html: Option<PathBuf>, pub html: Option<PathBuf>,
@ -90,7 +90,7 @@ pub struct WindowAttr {
pub transparent: bool, pub transparent: bool,
pub decorations: bool, pub decorations: bool,
pub always_on_top: bool, pub always_on_top: bool,
pub window_icon: Option<Icon>, pub icon: Option<Icon>,
} }
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Serialize, Deserialize, Clone, Debug)]
@ -244,7 +244,7 @@ impl Default for Config {
transparent: false, transparent: false,
decorations: true, decorations: true,
always_on_top: false, always_on_top: false,
window_icon: None, icon: None,
spa: false, spa: false,
url: Some("/index.html".into()), url: Some("/index.html".into()),
html: None, html: None,
@ -268,7 +268,7 @@ impl Config {
transparent: self.transparent, transparent: self.transparent,
decorations: self.decorations, decorations: self.decorations,
always_on_top: self.always_on_top, always_on_top: self.always_on_top,
window_icon: match &self.window_icon { icon: match &self.icon {
Some(path) => Some(load_icon(path.as_path())?), Some(path) => Some(load_icon(path.as_path())?),
None => None, None => None,
}, },

View File

@ -51,7 +51,7 @@ pub fn dev(config_path: String) -> wry::Result<()> {
true => window_builder.with_fullscreen(Some(Fullscreen::Borderless(None))), true => window_builder.with_fullscreen(Some(Fullscreen::Borderless(None))),
false => window_builder, false => window_builder,
}; };
let window_builder = match config.window_attr()?.window_icon { let window_builder = match config.window_attr()?.icon {
Some(ref icon) => window_builder.with_window_icon(Some(Icon::from_rgba( Some(ref icon) => window_builder.with_window_icon(Some(Icon::from_rgba(
icon.rgba.clone(), icon.rgba.clone(),
icon.width, icon.width,

View File

@ -62,7 +62,7 @@ pub struct Config {
pub transparent: bool, pub transparent: bool,
pub decorations: bool, pub decorations: bool,
pub always_on_top: bool, pub always_on_top: bool,
pub window_icon: Option<PathBuf>, pub icon: Option<PathBuf>,
pub spa: bool, pub spa: bool,
pub url: Option<String>, pub url: Option<String>,
pub html: Option<PathBuf>, pub html: Option<PathBuf>,
@ -212,7 +212,7 @@ impl Default for Config {
transparent: false, transparent: false,
decorations: true, decorations: true,
always_on_top: false, always_on_top: false,
window_icon: None, icon: None,
spa: false, spa: false,
url: Some("/index.html".into()), url: Some("/index.html".into()),
html: None, html: None,