diff --git a/Cargo.toml b/Cargo.toml index 6b29b0a..a2fe9e2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,23 +1,7 @@ -[package] -name = "popcorn" -version = "0.1.0" -edition = "2024" -description = "Cute and simple OSD popups on your desktop" -readme = "README.md" -repository = "https://git.candifloss.cc/candifloss/popcorn.git" -authors = ["Candifloss "] -categories = ["Desktop", "GUI"] -license-file = "LICENSE" -homepage = "https://git.candifloss.cc/candifloss/popcorn.git" -keywords = ["OSD", "popup", "desktop", "gui", "slint"] -license = "GPL-3+" - -[dependencies] -dirs = "6.0.0" -i-slint-backend-winit = "1.14.1" -serde_json = "1.0.145" -slint = "1.14.1" -toml = "0.9.8" - -[build-dependencies] -slint-build = "1.14.1" +[workspace] +resolver = "3" +members = [ + "crates/popcorn", + "crates/popcorn-d", + "crates/popcorn-conf", +] \ No newline at end of file diff --git a/crates/popcorn-conf/Cargo.toml b/crates/popcorn-conf/Cargo.toml new file mode 100644 index 0000000..2dd1764 --- /dev/null +++ b/crates/popcorn-conf/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "popcorn-conf" +version = "0.1.0" +edition = "2024" +description = "Configuration structures and loader for Popcorn OSD." +license = "GPL-3+" + +[dependencies] +dirs = "6.0.0" +serde = { version = "1.0.228", features = ["derive"] } +thiserror = "2.0.17" +toml = "0.9.8" + diff --git a/crates/popcorn-conf/src/lib.rs b/crates/popcorn-conf/src/lib.rs new file mode 100644 index 0000000..53f8cad --- /dev/null +++ b/crates/popcorn-conf/src/lib.rs @@ -0,0 +1,15 @@ +#[must_use] +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/crates/popcorn-d/Cargo.toml b/crates/popcorn-d/Cargo.toml new file mode 100644 index 0000000..92f16e0 --- /dev/null +++ b/crates/popcorn-d/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "popcorn-d" +version = "0.1.0" +edition = "2024" +description = "Popcorn OSD daemon to watch for system events." +license = "GPL-3+" + +[dependencies] +serde = { version = "1.0.228", features = ["derive"] } +tokio = { version = "1.48.0", features = ["full"] } diff --git a/src/main.rs b/crates/popcorn-d/src/main.rs similarity index 100% rename from src/main.rs rename to crates/popcorn-d/src/main.rs diff --git a/crates/popcorn/Cargo.toml b/crates/popcorn/Cargo.toml new file mode 100644 index 0000000..1d69f59 --- /dev/null +++ b/crates/popcorn/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "popcorn" +version = "0.1.0" +edition = "2024" +description = "Cute and simple OSD popups on your desktop" +readme = "README.md" +repository = "https://git.candifloss.cc/candifloss/popcorn.git" +authors = ["Candifloss "] +categories = ["Desktop", "GUI"] +homepage = "https://git.candifloss.cc/candifloss/popcorn.git" +keywords = ["OSD", "popup", "desktop", "gui", "slint"] +license = "GPL-3+" +build = "build.rs" + +[dependencies] +dirs = "6.0.0" +i-slint-backend-winit = "1.14.1" +serde_json = "1.0.145" +slint = "1.14.1" +toml = "0.9.8" +popcorn-conf = { path = "../popcorn-conf" } +clap = { version = "4.5.53", features = ["derive"] } +serde = { version = "1.0.228", features = ["derive"] } + +[build-dependencies] +slint-build = "1.14.1" diff --git a/build.rs b/crates/popcorn/build.rs similarity index 97% rename from build.rs rename to crates/popcorn/build.rs index ddf114d..7568548 100644 --- a/build.rs +++ b/crates/popcorn/build.rs @@ -1,3 +1,3 @@ fn main() { slint_build::compile("ui/osd-popup.slint").unwrap(); -} \ No newline at end of file +} diff --git a/crates/popcorn/src/main.rs b/crates/popcorn/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/crates/popcorn/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/ui/osd-popup.slint b/crates/popcorn/ui/osd-popup.slint similarity index 99% rename from ui/osd-popup.slint rename to crates/popcorn/ui/osd-popup.slint index b4e527d..c8a2ec8 100644 --- a/ui/osd-popup.slint +++ b/crates/popcorn/ui/osd-popup.slint @@ -33,7 +33,7 @@ export component OSDpopup inherits Window { background: osd_bg_color; } - // + // Filled color osd_fill:= Rectangle { height: 100%; width: (popup_width/100) * percent_value *1px;