Initial GUI application

This commit is contained in:
Quentin Boyer 2023-11-09 23:17:53 +01:00
parent 4f1638fc4f
commit 90b987c7b0
4 changed files with 2906 additions and 5 deletions

2867
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,8 @@
[package]
name = "todo_change_name"
name = "glaurung"
version = "0.1.0"
authors = ["traxys <quentin@familleboyer.net>"]
edition = "2021"
[dependencies]
iced = "0.10.0"

View file

@ -22,13 +22,21 @@
cargo = rust;
rustc = rust;
};
libPath = with pkgs; lib.makeLibraryPath [libxkbcommon wayland];
in {
devShell = pkgs.mkShell {
nativeBuildInputs = [rust];
RUST_PATH = "${rust}";
RUST_DOC_PATH = "${rust}/share/doc/rust/html/std/index.html";
LD_LIBRARY_PATH = libPath;
};
defaultPackage = naersk'.buildPackage ./.;
defaultPackage = naersk'.buildPackage {
src = ./.;
nativeBuildInputs = [pkgs.makeWrapper];
postInstall = ''
wrapProgram "$out/bin/glaurung" --prefix LD_LIBRARY_PATH : "${libPath}"
'';
};
});
}

View file

@ -1,3 +1,30 @@
fn main() {
println!("Hello");
use iced::{widget::column, Sandbox, Settings};
#[derive(Clone, Copy, Debug)]
enum Message {}
struct Glaurung {}
impl Sandbox for Glaurung {
type Message = Message;
fn new() -> Self {
Self {}
}
fn title(&self) -> String {
"Glaurung - Account Manager".into()
}
fn update(&mut self, message: Self::Message) {
match message {}
}
fn view(&self) -> iced::Element<'_, Self::Message> {
column![].into()
}
}
fn main() -> iced::Result {
Glaurung::run(Settings::default())
}