diff --git a/.gitignore b/.gitignore index ab951f8..12e3f65 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,10 @@ Cargo.lock # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ + +# Added by me +/test + +# Added by cargo + +/target diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..6801a13 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "power-menu" +version = "0.1.0" +edition = "2024" +build = "build.rs" + +[dependencies] +i-slint-backend-winit = { version = "1.14.1", default-features = false, features = ["x11"] } +slint = { version = "1.14.1", default-features = false, features = ["backend-winit", "compat-1-2", "renderer-software"] } + +[build-dependencies] +slint-build = "1.14.1" diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..5c4e973 --- /dev/null +++ b/build.rs @@ -0,0 +1,3 @@ +fn main() { + slint_build::compile("ui/power-menu.slint").unwrap(); +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..67b0ad6 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,15 @@ +use i_slint_backend_winit::{ + Backend, + winit::{ + platform::x11::{WindowAttributesExtX11, WindowType}, + window::WindowAttributes, + }, +}; +slint::include_modules!(); + +fn main() -> Result<(), Box> { + let ui = PowerMenu::new()?; + ui.run(); + + Ok(()) +} diff --git a/ui/power-menu.slint b/ui/power-menu.slint new file mode 100644 index 0000000..39c6bda --- /dev/null +++ b/ui/power-menu.slint @@ -0,0 +1,4 @@ +export component PowerMenu inherits Window { + background: #adadad57; + no-frame: true; +} \ No newline at end of file