Re-organize project

- 3 Crates:
  - UI: Move existing crate
  - Daemon: Init binary crate
  - Config: Init library crate
This commit is contained in:
Candifloss 2025-12-10 10:40:38 +05:30
parent 971ecf4200
commit 7659b22dd6
9 changed files with 76 additions and 25 deletions

View File

@ -1,23 +1,7 @@
[package] [workspace]
name = "popcorn" resolver = "3"
version = "0.1.0" members = [
edition = "2024" "crates/popcorn",
description = "Cute and simple OSD popups on your desktop" "crates/popcorn-d",
readme = "README.md" "crates/popcorn-conf",
repository = "https://git.candifloss.cc/candifloss/popcorn.git" ]
authors = ["Candifloss <candifloss.cc>"]
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"

View File

@ -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"

View File

@ -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);
}
}

View File

@ -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"] }

26
crates/popcorn/Cargo.toml Normal file
View File

@ -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 <candifloss.cc>"]
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"

View File

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

View File

@ -33,7 +33,7 @@ export component OSDpopup inherits Window {
background: osd_bg_color; background: osd_bg_color;
} }
// // Filled color
osd_fill:= Rectangle { osd_fill:= Rectangle {
height: 100%; height: 100%;
width: (popup_width/100) * percent_value *1px; width: (popup_width/100) * percent_value *1px;