mirror of https://github.com/rocboss/paopao-ce
Merge pull request #49 from alimy/pr-tauri
add a simple desktop frontend implement base rust+tauripull/51/head
commit
047ab9fca5
After Width: | Height: | Size: 304 KiB |
@ -0,0 +1,5 @@
|
|||||||
|
# Generated by Cargo
|
||||||
|
# will have compiled files and executables
|
||||||
|
/target/
|
||||||
|
WixTools
|
||||||
|
Cargo.lock
|
@ -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" ]
|
@ -0,0 +1,3 @@
|
|||||||
|
fn main() {
|
||||||
|
tauri_build::build()
|
||||||
|
}
|
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 91 KiB |
@ -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");
|
||||||
|
}
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue