Add fltk for UI

This commit is contained in:
Philip Kristoffersen
2021-09-27 21:14:59 +02:00
parent f46bc063c3
commit 27ec46ad8a
3 changed files with 62 additions and 1 deletions
Generated
+50
View File
@@ -113,6 +113,15 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "cmake"
version = "0.1.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855"
dependencies = [
"cc",
]
[[package]] [[package]]
name = "config" name = "config"
version = "0.11.0" version = "0.11.0"
@@ -185,6 +194,37 @@ dependencies = [
"synstructure", "synstructure",
] ]
[[package]]
name = "fltk"
version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd19f0144a75a2a1b282c626069a0dd91fdb97779a9638e9658ef6f9cfca284f"
dependencies = [
"bitflags",
"fltk-derive",
"fltk-sys",
"raw-window-handle",
]
[[package]]
name = "fltk-derive"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "517c3b4815e56f38981c7cf0d58082b8e87501f245c459dada9aa09edf5bbdc6"
dependencies = [
"quote",
"syn",
]
[[package]]
name = "fltk-sys"
version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8e949c024948f1529c92e10a6389cdafeda82d2ba526ef71a0a087234f0db03"
dependencies = [
"cmake",
]
[[package]] [[package]]
name = "fnv" name = "fnv"
version = "1.0.7" version = "1.0.7"
@@ -804,6 +844,15 @@ dependencies = [
"rand_core", "rand_core",
] ]
[[package]]
name = "raw-window-handle"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.2.10" version = "0.2.10"
@@ -1035,6 +1084,7 @@ version = "0.2.0"
dependencies = [ dependencies = [
"config", "config",
"failure", "failure",
"fltk",
"reqwest", "reqwest",
"serde 1.0.130", "serde 1.0.130",
"serde_json", "serde_json",
+2
View File
@@ -14,3 +14,5 @@ tokio = { version = "1.11.0", features = ["full"] }
reqwest = { version = "0.11.4", features = ["default"] } reqwest = { version = "0.11.4", features = ["default"] }
config = "0.11.0" config = "0.11.0"
failure = "0.1.8" failure = "0.1.8"
#https://fltk-rs.github.io/fltk-rs/
fltk = { version = "^1.2", features = ["fltk-bundled"] }
+9
View File
@@ -6,6 +6,8 @@ mod platform;
mod settings; mod settings;
mod steam; mod steam;
mod steamgriddb; mod steamgriddb;
use fltk::{app, prelude::*, window::Window};
use crate::{ use crate::{
egs::EpicPlatform, egs::EpicPlatform,
@@ -19,6 +21,13 @@ use steam_shortcuts_util::{shortcut::ShortcutOwned, shortcuts_to_bytes, Shortcut
#[tokio::main] #[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> { async fn main() -> Result<(), Box<dyn Error>> {
let app = app::App::default();
let mut wind = Window::new(100, 100, 400, 300, "Hello from rust");
wind.end();
wind.show();
app.run().unwrap();
let settings = Settings::new()?; let settings = Settings::new()?;
let auth_key = settings.steamgrid_db.auth_key; let auth_key = settings.steamgrid_db.auth_key;