-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
/target/ | ||
WixTools | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
config.json | ||
bundle.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[package] | ||
name = "tauri-03-budgetapp" | ||
version = "0.1.0" | ||
description = "A Tauri App" | ||
authors = [ "you" ] | ||
license = "" | ||
repository = "" | ||
default-run = "tauri-03-budgetapp" | ||
edition = "2018" | ||
build = "src/build.rs" | ||
|
||
[dependencies] | ||
serde_json = "1.0" | ||
serde = { version = "1.0", features = [ "derive" ] } | ||
tauri = { version = "0.9", features = [ "all-api" ] } | ||
|
||
[target."cfg(windows)".build-dependencies] | ||
winres = "0.1" | ||
|
||
[features] | ||
embedded-server = [ "tauri/embedded-server" ] | ||
no-server = [ "tauri/no-server" ] | ||
|
||
[[bin]] | ||
name = "tauri-03-budgetapp" | ||
path = "src/main.rs" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
max_width = 100 | ||
hard_tabs = false | ||
tab_spaces = 2 | ||
newline_style = "Auto" | ||
use_small_heuristics = "Default" | ||
reorder_imports = true | ||
reorder_modules = true | ||
remove_nested_parens = true | ||
edition = "2018" | ||
merge_derives = true | ||
use_try_shorthand = false | ||
use_field_init_shorthand = false | ||
force_explicit_abi = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#[cfg(windows)] | ||
extern crate winres; | ||
|
||
#[cfg(windows)] | ||
fn main() { | ||
if std::path::Path::new("icons/icon.ico").exists() { | ||
let mut res = winres::WindowsResource::new(); | ||
res.set_icon("icons/icon.ico"); | ||
res.compile().expect("Unable to find visual studio tools"); | ||
} else { | ||
panic!("No Icon.ico found. Please add one or check the path"); | ||
} | ||
} | ||
|
||
#[cfg(not(windows))] | ||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use serde::Deserialize; | ||
|
||
#[derive(Deserialize)] | ||
#[serde(tag = "cmd", rename_all = "camelCase")] | ||
pub enum Cmd { | ||
// your custom commands | ||
// multiple arguments are allowed | ||
// note that rename_all = "camelCase": you need to use "myCustomCommand" on JS | ||
MyCustomCommand { argument: String }, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#![cfg_attr( | ||
all(not(debug_assertions), target_os = "windows"), | ||
windows_subsystem = "windows" | ||
)] | ||
|
||
mod cmd; | ||
|
||
fn main() { | ||
tauri::AppBuilder::new() | ||
.invoke_handler(|_webview, arg| { | ||
use cmd::Cmd::*; | ||
match serde_json::from_str(arg) { | ||
Err(e) => { | ||
Err(e.to_string()) | ||
} | ||
Ok(command) => { | ||
match command { | ||
// definitions for your custom commands from Cmd here | ||
MyCustomCommand { argument } => { | ||
// your command code | ||
println!("{}", argument); | ||
} | ||
} | ||
Ok(()) | ||
} | ||
} | ||
}) | ||
.build() | ||
.run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"build": { | ||
"distDir": "../dist", | ||
"devPath": "http://localhost:4000", | ||
"beforeDevCommand": "", | ||
"beforeBuildCommand": "" | ||
}, | ||
"ctx": {}, | ||
"tauri": { | ||
"embeddedServer": { | ||
"active": true | ||
}, | ||
"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" | ||
], | ||
"resources": [], | ||
"externalBin": [], | ||
"copyright": "", | ||
"category": "DeveloperTool", | ||
"shortDescription": "", | ||
"longDescription": "", | ||
"deb": { | ||
"depends": [], | ||
"useBootstrapper": false | ||
}, | ||
"osx": { | ||
"frameworks": [], | ||
"minimumSystemVersion": "", | ||
"useBootstrapper": false | ||
}, | ||
"exceptionDomain": "" | ||
}, | ||
"allowlist": { | ||
"all": true | ||
}, | ||
"window": { | ||
"title": "Budget Appka", | ||
"width": 800, | ||
"height": 600, | ||
"resizable": true, | ||
"fullscreen": false | ||
}, | ||
"security": { | ||
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'" | ||
}, | ||
"inliner": { | ||
"active": true | ||
} | ||
} | ||
} |