-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from alimy/pr-tauri
add a simple desktop frontend implement base rust+tauri
- Loading branch information
Showing
14 changed files
with
248 additions
and
3 deletions.
There are no files selected for viewing
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
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
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,5 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
/target/ | ||
WixTools | ||
Cargo.lock |
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,23 @@ | ||
[package] | ||
name = "paopao" | ||
version = "0.1.0" | ||
description = "Paopao App" | ||
authors = ["Rocboss"] | ||
license = "MIT License" | ||
repository = "https://github.com/rocboss/paopao-ce" | ||
edition = "2021" | ||
rust-version = "1.57" | ||
|
||
[build-dependencies] | ||
tauri-build = { version = "1.0.0-rc.4", features = [] } | ||
|
||
[dependencies] | ||
tauri = { version = "1.0.0-rc.4", features = ["api-all"] } | ||
|
||
[features] | ||
# by default Tauri runs in production mode | ||
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL | ||
default = [ "custom-protocol" ] | ||
# this feature is used used for production builds where `devPath` points to the filesystem | ||
# DO NOT remove this | ||
custom-protocol = [ "tauri/custom-protocol" ] |
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,3 @@ | ||
fn main() { | ||
tauri_build::build() | ||
} |
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.
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,52 @@ | ||
#![cfg_attr( | ||
all(not(debug_assertions), target_os = "windows"), | ||
windows_subsystem = "windows" | ||
)] | ||
|
||
use tauri::api::shell; | ||
use tauri::{CustomMenuItem, Manager, Menu, MenuEntry, MenuItem, Submenu}; | ||
|
||
fn main() { | ||
let _ctx = tauri::generate_context!(); | ||
|
||
tauri::Builder::default() | ||
.menu(Menu::with_items([ | ||
#[cfg(target_os = "macos")] | ||
MenuEntry::Submenu(Submenu::new( | ||
&_ctx.package_info().name, | ||
Menu::with_items([ | ||
MenuItem::Separator.into(), | ||
MenuItem::Services.into(), | ||
MenuItem::Separator.into(), | ||
MenuItem::Hide.into(), | ||
MenuItem::HideOthers.into(), | ||
MenuItem::ShowAll.into(), | ||
MenuItem::Separator.into(), | ||
MenuItem::Quit.into(), | ||
]), | ||
)), | ||
MenuEntry::Submenu(Submenu::new( | ||
"Window", | ||
Menu::with_items([MenuItem::Minimize.into(), MenuItem::Zoom.into()]), | ||
)), | ||
// You should always have a Help menu on macOS because it will automatically | ||
// show a menu search field | ||
MenuEntry::Submenu(Submenu::new( | ||
"Help", | ||
Menu::with_items([CustomMenuItem::new("Learn More", "Learn More").into()]), | ||
)), | ||
])) | ||
.on_menu_event(|event| { | ||
let event_name = event.menu_item_id(); | ||
event.window().emit("menu", event_name).unwrap(); | ||
match event_name { | ||
"Learn More" => { | ||
let link = "https://github.com/rocboss/paopao-ce".to_string(); | ||
shell::open(&event.window().shell_scope(), link, None).unwrap(); | ||
} | ||
_ => {} | ||
} | ||
}) | ||
.run(tauri::generate_context!()) | ||
.expect("error while running tauri application"); | ||
} |
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,74 @@ | ||
{ | ||
"package": { | ||
"productName": "Paopao", | ||
"version": "0.1.0" | ||
}, | ||
"build": { | ||
"distDir": "../dist", | ||
"beforeDevCommand": "", | ||
"beforeBuildCommand": "", | ||
"withGlobalTauri": true | ||
}, | ||
"tauri": { | ||
"bundle": { | ||
"active": true, | ||
"targets": "all", | ||
"identifier": "tauri.paopao.info", | ||
"icon": [ | ||
"icons/32x32.png", | ||
"icons/128x128.png", | ||
"icons/128x128@2x.png", | ||
"icons/icon.icns", | ||
"icons/icon.ico" | ||
], | ||
"resources": [], | ||
"externalBin": [], | ||
"copyright": "", | ||
"category": "Social Networking", | ||
"shortDescription": "", | ||
"longDescription": "", | ||
"deb": { | ||
"depends": [] | ||
}, | ||
"macOS": { | ||
"frameworks": [], | ||
"minimumSystemVersion": "", | ||
"exceptionDomain": "", | ||
"signingIdentity": null, | ||
"providerShortName": null, | ||
"entitlements": null | ||
}, | ||
"windows": { | ||
"certificateThumbprint": null, | ||
"digestAlgorithm": "sha256", | ||
"timestampUrl": "" | ||
} | ||
}, | ||
"updater": { | ||
"active": false | ||
}, | ||
"allowlist": { | ||
"all": true, | ||
"http": { | ||
"all": true, | ||
"request": true, | ||
"scope": ["https://**", "http://**"] | ||
}, | ||
"notification": { | ||
"all": true | ||
} | ||
}, | ||
"windows": [ | ||
{ | ||
"title": "泡泡 - 闲了,冒个泡", | ||
"width": 1080, | ||
"height": 800, | ||
"resizable": true, | ||
"fullscreen": false | ||
} | ||
], | ||
"security": { | ||
"csp": null | ||
} | ||
} | ||
} |
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