GUI initial commit
24
theseus_gui/src-tauri/Cargo.toml
Normal file
@@ -0,0 +1,24 @@
|
||||
[package]
|
||||
name = "theseus_gui"
|
||||
version = "0.1.0"
|
||||
default-run = "theseus_gui"
|
||||
edition = "2021"
|
||||
rust-version = "1.57"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "1.0.0-rc.3", features = [] }
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tauri = { version = "1.0.0-rc.3", 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" ]
|
||||
3
theseus_gui/src-tauri/build.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
tauri_build::build()
|
||||
}
|
||||
BIN
theseus_gui/src-tauri/icons/128x128.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
theseus_gui/src-tauri/icons/128x128@2x.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
theseus_gui/src-tauri/icons/32x32.png
Normal file
|
After Width: | Height: | Size: 974 B |
BIN
theseus_gui/src-tauri/icons/Square107x107Logo.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
theseus_gui/src-tauri/icons/Square142x142Logo.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
theseus_gui/src-tauri/icons/Square150x150Logo.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
theseus_gui/src-tauri/icons/Square284x284Logo.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
theseus_gui/src-tauri/icons/Square30x30Logo.png
Normal file
|
After Width: | Height: | Size: 903 B |
BIN
theseus_gui/src-tauri/icons/Square310x310Logo.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
theseus_gui/src-tauri/icons/Square44x44Logo.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
theseus_gui/src-tauri/icons/Square71x71Logo.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
theseus_gui/src-tauri/icons/Square89x89Logo.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
theseus_gui/src-tauri/icons/StoreLogo.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
theseus_gui/src-tauri/icons/icon.icns
Normal file
BIN
theseus_gui/src-tauri/icons/icon.ico
Normal file
|
After Width: | Height: | Size: 85 KiB |
BIN
theseus_gui/src-tauri/icons/icon.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
89
theseus_gui/src-tauri/src/main.rs
Normal file
@@ -0,0 +1,89 @@
|
||||
#![cfg_attr(
|
||||
all(not(debug_assertions), target_os = "windows"),
|
||||
windows_subsystem = "windows"
|
||||
)]
|
||||
|
||||
use tauri::api::shell;
|
||||
use tauri::{
|
||||
CustomMenuItem, Manager, Menu, MenuEntry, MenuItem, Submenu, WindowBuilder, WindowUrl,
|
||||
};
|
||||
|
||||
fn main() {
|
||||
let ctx = tauri::generate_context!();
|
||||
|
||||
tauri::Builder::default()
|
||||
.invoke_handler(tauri::generate_handler![])
|
||||
.create_window("main", WindowUrl::default(), |win, webview| {
|
||||
let win = win
|
||||
.title("Modrinth")
|
||||
.resizable(true)
|
||||
.decorations(true)
|
||||
.always_on_top(false)
|
||||
.inner_size(800.0, 550.0)
|
||||
.min_inner_size(400.0, 200.0)
|
||||
.skip_taskbar(false)
|
||||
.fullscreen(false);
|
||||
return (win, webview);
|
||||
})
|
||||
.menu(Menu::with_items([
|
||||
#[cfg(target_os = "macos")]
|
||||
MenuEntry::Submenu(Submenu::new(
|
||||
&ctx.package_info().name,
|
||||
Menu::with_items([
|
||||
MenuItem::About(ctx.package_info().name.clone()).into(),
|
||||
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(
|
||||
"File",
|
||||
Menu::with_items([MenuItem::CloseWindow.into()]),
|
||||
)),
|
||||
MenuEntry::Submenu(Submenu::new(
|
||||
"Edit",
|
||||
Menu::with_items([
|
||||
MenuItem::Undo.into(),
|
||||
MenuItem::Redo.into(),
|
||||
MenuItem::Separator.into(),
|
||||
MenuItem::Cut.into(),
|
||||
MenuItem::Copy.into(),
|
||||
MenuItem::Paste.into(),
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
MenuItem::Separator.into(),
|
||||
MenuItem::SelectAll.into(),
|
||||
]),
|
||||
)),
|
||||
MenuEntry::Submenu(Submenu::new(
|
||||
"View",
|
||||
Menu::with_items([MenuItem::EnterFullScreen.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();
|
||||
match event_name {
|
||||
"Learn More" => {
|
||||
let url = "https://github.com/probablykasper/tauri-template".to_string();
|
||||
shell::open(&event.window().shell_scope(), url, None).unwrap();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
})
|
||||
.run(ctx)
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
63
theseus_gui/src-tauri/tauri.conf.json
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"package": {
|
||||
"productName": "Modrinth"
|
||||
},
|
||||
"build": {
|
||||
"distDir": "../build",
|
||||
"devPath": "http://localhost:3000",
|
||||
"beforeDevCommand": "pnpm dev:web",
|
||||
"beforeBuildCommand": "pnpm run build:web"
|
||||
},
|
||||
"tauri": {
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": [
|
||||
"dmg",
|
||||
"deb",
|
||||
"appimage",
|
||||
"msi"
|
||||
],
|
||||
"identifier": "com.modrinth.theseus",
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
],
|
||||
"resources": [],
|
||||
"externalBin": [],
|
||||
"copyright": "",
|
||||
"category": "Game",
|
||||
"shortDescription": "",
|
||||
"longDescription": "",
|
||||
"deb": {
|
||||
"depends": [],
|
||||
"useBootstrapper": false
|
||||
},
|
||||
"macOS": {
|
||||
"frameworks": [],
|
||||
"minimumSystemVersion": "",
|
||||
"useBootstrapper": false,
|
||||
"exceptionDomain": "",
|
||||
"signingIdentity": null,
|
||||
"providerShortName": null,
|
||||
"entitlements": null
|
||||
},
|
||||
"windows": {
|
||||
"certificateThumbprint": null,
|
||||
"digestAlgorithm": "sha256",
|
||||
"timestampUrl": ""
|
||||
}
|
||||
},
|
||||
"updater": {
|
||||
"active": false
|
||||
},
|
||||
"allowlist": {
|
||||
"all": true
|
||||
},
|
||||
"security": {
|
||||
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
|
||||
}
|
||||
}
|
||||
}
|
||||