diff --git a/Cargo.toml b/Cargo.toml index 6801a13..0abb73e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,9 @@ build = "build.rs" [dependencies] i-slint-backend-winit = { version = "1.14.1", default-features = false, features = ["x11"] } +serde = { version = "1.0.228", default-features = false, features = ["derive"] } slint = { version = "1.14.1", default-features = false, features = ["backend-winit", "compat-1-2", "renderer-software"] } +toml = "0.9.11" [build-dependencies] slint-build = "1.14.1" diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 0000000..b7b7cd0 --- /dev/null +++ b/src/config.rs @@ -0,0 +1,65 @@ +use serde::Deserialize; +use slint::{Color, SharedString}; +use std::{fs, path::PathBuf}; + +#[derive(Debug, Deserialize)] +pub struct Config { + pub screen: Option, + pub menu_popup: Option, + pub buttons: Option, + pub button: Option, + pub options: Option>, +} + +#[derive(Debug, Deserialize)] +pub struct ScreenConfig { + pub width: Option, + pub height: Option, + pub bg_color: Option, +} + +#[derive(Debug, Deserialize)] +pub struct MenuPopupConfig { + pub width: Option, + pub height: Option, + pub bg_color: Option, + pub border_radius: Option, + pub padding_x: Option, + pub padding_y: Option, + pub button_spacing: Option, + pub pos_x: Option, + pub pos_y: Option, +} + +#[derive(Debug, Deserialize)] +pub struct ButtonConfig { + pub width: Option, + pub height: Option, + pub border_radius: Option, + pub bg_color_normal: Option, + pub bg_color_hover: Option, + pub bg_color_clicked: Option, +} + +#[derive(Debug, Deserialize)] +pub struct ButtonContentConfig { + pub icon: Option, + pub text: Option, +} + +#[derive(Debug, Deserialize)] +pub struct ButtonPartConfig { + pub width: Option, + pub height: Option, + pub font_size: Option, + pub font: Option, + pub color: Option, +} + +#[derive(Debug, Deserialize)] +pub struct MenuOption { + pub id: String, + pub icon: String, + pub text: String, + pub command: String, +} diff --git a/src/main.rs b/src/main.rs index 642ce44..df70f35 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,7 @@ use i_slint_backend_winit::{ }, }; +mod config; mod powermenu; fn main() -> Result<(), Box> {