Add a custom Windows title bar (#24)
CI / core (pull_request) Successful in 1m17s

This commit is contained in:
nessar committed 2026-11-18 21:11:21 +01:00
1 parent a2d58c000c
commit 23eb933a68
5 files changed
+268 -70

No files matched your search

+4 -13
View File
@@ -19,22 +19,13 @@ pub struct Config {
other: toml::Table,
}
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
#[serde(default)]
pub struct Preferences {
pub close_to_tray: bool,
pub theme: ThemePreference,
}
impl Default for Preferences {
fn default() -> Self {
Self {
close_to_tray: true,
theme: ThemePreference::System,
}
}
}
#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum ThemePreference {
@@ -107,7 +98,7 @@ mod tests {
let config = load("riot_api_key = \"k\"\nriot_id = \"Joueur#EUW\"\n").unwrap();
assert_eq!(config.riot_id, "Joueur#EUW");
assert_eq!(config.region, "europe");
assert!(config.preferences.close_to_tray);
assert!(!config.preferences.close_to_tray);
assert_eq!(config.preferences.theme, ThemePreference::System);
}
@@ -145,7 +136,7 @@ mod tests {
("", "", "europe")
);
assert!(!dir.path().join("config.toml").exists());
assert!(config.preferences.close_to_tray);
assert!(!config.preferences.close_to_tray);
assert_eq!(config.preferences.theme, ThemePreference::System);
}
@@ -160,7 +151,7 @@ mod tests {
.unwrap();
let mut config = Config::load(&path).unwrap();
config.preferences = Preferences {
close_to_tray: false,
close_to_tray: true,
theme: ThemePreference::Dark,
};
config.save(&path).unwrap();