numerous improvements in gui and feature code

This commit is contained in:
2025-04-19 04:28:24 +01:00
parent 0257834d04
commit 27524e855a
7 changed files with 176 additions and 218 deletions
+6 -21
View File
@@ -1,12 +1,15 @@
use serde::{Deserialize, Serialize};
use std::fmt::Display;
use strum::EnumIter;
use strum::{Display, EnumIter};
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, EnumIter)]
#[derive(Clone, Copy, Debug, Display, PartialEq, Eq, Serialize, Deserialize, EnumIter)]
pub enum Theme {
#[strum(to_string = "Catppuccin Latte")]
CatppuccinLatte,
#[strum(to_string = "Catppuccin Frappe")]
CatppuccinFrappe,
#[strum(to_string = "Catppuccin Macchiato")]
CatppuccinMacchiato,
#[strum(to_string = "Catppuccin Mocha")]
CatppuccinMocha,
}
@@ -21,24 +24,6 @@ impl From<Theme> for catppuccin_egui::Theme {
}
}
impl Display for Theme {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let x = match self {
Self::CatppuccinLatte => "Catppuccin Latte",
Self::CatppuccinFrappe => "Catppuccin Frappe",
Self::CatppuccinMacchiato => "Catppuccin Macchiato",
Self::CatppuccinMocha => "Catppuccin Mocha",
};
write!(f, "{x}")
}
}
impl Theme {
pub fn to_catppuccin(self) -> catppuccin_egui::Theme {
self.into()
}
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Settings {
pub theme: Theme,