Development Branch on new Machine
@@ -0,0 +1,7 @@
|
||||
# Generated by Cargo
|
||||
# will have compiled files and executables
|
||||
/target/
|
||||
|
||||
# Generated by Tauri
|
||||
# will have schema files for capabilities auto-completion
|
||||
/gen/schemas
|
||||
@@ -0,0 +1,21 @@
|
||||
[package]
|
||||
name = "champ"
|
||||
version = "2024.10.1"
|
||||
description = "Central Helpdesk Application and Management Platform"
|
||||
authors = ["James Brotosky, Joe Linnemeier"]
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "1", features = [] }
|
||||
|
||||
[dependencies]
|
||||
tauri = { version = "1", features = ["shell-open"] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
azul = "0.1.0"
|
||||
|
||||
[features]
|
||||
# This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!!
|
||||
custom-protocol = ["tauri/custom-protocol"]
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
tauri_build::build()
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 974 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 903 B |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 14 KiB |
@@ -0,0 +1,51 @@
|
||||
use azul::prelude::*;
|
||||
use azul::str::String as AzString;
|
||||
use azul::widgets::{Button, Label};
|
||||
|
||||
struct DataModel {
|
||||
counter: usize,
|
||||
}
|
||||
|
||||
extern "C" fn myLayoutFunc(
|
||||
data: &mut RefAny,
|
||||
_: &mut LayoutCallbackInfo
|
||||
) -> StyledDom {
|
||||
|
||||
let counter = match data.downcast_ref::<DataModel>() {
|
||||
Some(d) => format!("{}", d.counter),
|
||||
None => return StyledDom::default(),
|
||||
};
|
||||
|
||||
let mut label = Dom::text(counter.into());
|
||||
label.set_inline_style("font-size: 50px");
|
||||
|
||||
let mut button = Button::new("Update counter".into());
|
||||
button.set_on_click(data.clone(), myOnClick);
|
||||
let mut button = button.dom();
|
||||
button.set_inline_style("flex-grow: 1");
|
||||
|
||||
Dom::body()
|
||||
.with_child(label)
|
||||
.with_child(button)
|
||||
.style(Css::empty())
|
||||
}
|
||||
|
||||
extern "C"
|
||||
fn myOnClick(data: &mut RefAny, _: &mut CallbackInfo) -> Update {
|
||||
let mut data = match data.downcast_mut::<DataModel>() {
|
||||
Some(s) => s,
|
||||
None => return Update::DoNothing, // error
|
||||
};
|
||||
|
||||
data.counter += 1;
|
||||
|
||||
Update::RefreshDom
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let data = DataModel { counter: 0 };
|
||||
let config = AppConfig::new(LayoutSolver::Default);
|
||||
let app = App::new(RefAny::new(data), config);
|
||||
let window = WindowCreateOptions::new(myLayoutFunc);
|
||||
app.run(window);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"build": {
|
||||
"devPath": "../src",
|
||||
"distDir": "../src",
|
||||
"withGlobalTauri": true
|
||||
},
|
||||
"package": {
|
||||
"productName": "champ",
|
||||
"version": "0.0.0"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
"all": false,
|
||||
"shell": {
|
||||
"all": false,
|
||||
"open": true
|
||||
}
|
||||
},
|
||||
"windows": [
|
||||
{
|
||||
"title": "champ",
|
||||
"width": 800,
|
||||
"height": 600
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": null
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"identifier": "com.tauri.dev",
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||