Initial
This commit is contained in:
19
persmgr-gui-rs/Cargo.toml
Normal file
19
persmgr-gui-rs/Cargo.toml
Normal file
@@ -0,0 +1,19 @@
|
||||
[package]
|
||||
name = "persmgr-gui"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.99"
|
||||
image = "0.25.7"
|
||||
reqwest = { version = "0.12.23", features = ["json", "blocking"] }
|
||||
serde = { version = "1.0.219", features = ["derive"] }
|
||||
serde_json = "1.0.143"
|
||||
slint = { version = "1.12.1", features = ["gettext", "log", "serde", "image-default-formats"] }
|
||||
tokio = "1.47.1"
|
||||
toml = "0.9.5"
|
||||
tracing = "0.1.41"
|
||||
|
||||
|
||||
[build-dependencies]
|
||||
slint-build = "1.12.1"
|
||||
3
persmgr-gui-rs/build.rs
Normal file
3
persmgr-gui-rs/build.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
slint_build::compile("ui/main.slint").unwrap();
|
||||
}
|
||||
12
persmgr-gui-rs/src/main.rs
Normal file
12
persmgr-gui-rs/src/main.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
slint::include_modules!();
|
||||
|
||||
fn main() {
|
||||
let app = MainWindow::new().unwrap();
|
||||
|
||||
// connect callback
|
||||
app.on_clicked(|| {
|
||||
println!("Button was clicked owo");
|
||||
});
|
||||
|
||||
app.run().unwrap();
|
||||
}
|
||||
24
persmgr-gui-rs/ui/main.slint
Normal file
24
persmgr-gui-rs/ui/main.slint
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Button } from "std-widgets.slint";
|
||||
|
||||
|
||||
export component MainWindow inherits Window {
|
||||
width: 400px;
|
||||
height: 300px;
|
||||
title: "My Slint App :3";
|
||||
|
||||
VerticalLayout {
|
||||
Text {
|
||||
text: "Hello nya~ from Slint!";
|
||||
horizontal-alignment: center;
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Click me!";
|
||||
clicked => {
|
||||
root.clicked();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
callback clicked();
|
||||
}
|
||||
54
persmgr-gui-rs/ui/top_nav.slint
Normal file
54
persmgr-gui-rs/ui/top_nav.slint
Normal file
@@ -0,0 +1,54 @@
|
||||
import { Button } from "std-widgets.slint";
|
||||
export component TopNavBar inherits HorizontalLayout {
|
||||
height: 50px;
|
||||
spacing: 16px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
|
||||
// Permission flag for Management tab
|
||||
in property <bool> is_officer: false;
|
||||
|
||||
// callbacks for tabs
|
||||
callback dashboard_clicked();
|
||||
callback roster_clicked();
|
||||
callback management_clicked();
|
||||
callback documents_clicked();
|
||||
callback profile_clicked();
|
||||
callback user_account_clicked();
|
||||
callback user_preferences_clicked();
|
||||
callback user_logout_clicked();
|
||||
Button {
|
||||
text: "Dashboard";
|
||||
clicked() => {
|
||||
root.dashboard_clicked();
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Roster";
|
||||
clicked() => {
|
||||
root.roster_clicked();
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Management";
|
||||
clicked() => {
|
||||
root.management_clicked();
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Documents";
|
||||
clicked() => {
|
||||
root.documents_clicked();
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Your file";
|
||||
clicked() => {
|
||||
root.dashboard_clicked();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user