Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(collectibles): add basic window menu items #3847

Merged
merged 1 commit into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions applications/tari_collectibles/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ tari_key_manager = { path = "../../../base_layer/key_manager" }
tari_mmr = { path = "../../../base_layer/mmr"}
tari_utilities = "*"
tari_dan_common_types = { path = "../../../dan_layer/common_types"}
log = { version = "0.4.8", features = ["std"] }

blake2 = "^0.9.0"
futures = "0.3.17"
rand = "0.8"
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tonic = "0.6.2"
tauri = { version = "1.0.0-beta.8", features = ["api-all"] }
diesel = { version = "1.4.8", features = ["sqlite"] }
diesel_migrations = "1.4.0"
thiserror = "1.0.30"
uuid = { version = "0.8.2", features = ["serde"] }
futures = "0.3.17"
log = { version = "0.4.8", features = ["std"] }
prost = "0.9"
prost-types = "0.9"
rand = "0.8"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
structopt = "0.3.25"
tauri = { version = "1.0.0-rc.2", features = ["api-all"] }
thiserror = "1.0.30"
tokio = { version = "1.11", features = ["signal"] }
tonic = "0.6.2"
uuid = { version = "0.8.2", features = ["serde"] }

[features]
default = [ "custom-protocol" ]
Expand Down
28 changes: 26 additions & 2 deletions applications/tari_collectibles/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
)]

use std::error::Error;
use tauri::{Menu, MenuItem, Submenu};

use tari_app_utilities::initialization::init_configuration;
use tari_common::configuration::bootstrap::ApplicationType;
Expand Down Expand Up @@ -33,7 +34,8 @@ fn main() -> Result<(), Box<dyn Error>> {
config.collectibles_config.unwrap_or_default(),
);

let result = tauri::Builder::default()
tauri::Builder::default()
.menu(build_menu())
.manage(state)
.invoke_handler(tauri::generate_handler![
commands::create_db,
Expand All @@ -60,5 +62,27 @@ fn main() -> Result<(), Box<dyn Error>> {
])
.run(tauri::generate_context!())?;

Ok(result)
Ok(())
}

fn build_menu() -> Menu {
Menu::new()
.add_submenu(Submenu::new(
"Tari Collectibles",
Menu::new()
.add_native_item(MenuItem::Hide)
.add_native_item(MenuItem::Quit),
))
.add_submenu(Submenu::new(
"Edit",
Menu::new()
.add_native_item(MenuItem::Copy)
.add_native_item(MenuItem::Cut)
.add_native_item(MenuItem::Paste)
.add_native_item(MenuItem::Separator)
.add_native_item(MenuItem::Undo)
.add_native_item(MenuItem::Redo)
.add_native_item(MenuItem::Separator)
.add_native_item(MenuItem::SelectAll),
))
}
4 changes: 2 additions & 2 deletions applications/tari_collectibles/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"package": {
"productName": "tari_collectibles",
"productName": "Tari Collectibles",
"version": "0.1.0"
},
"build": {
Expand Down Expand Up @@ -53,7 +53,7 @@
},
"windows": [
{
"title": "tari_collectibles",
"title": "Tari Collectibles",
"width": 1524,
"height": 800,
"resizable": true,
Expand Down
2 changes: 1 addition & 1 deletion applications/tari_collectibles/web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@emotion/styled": "^11.3.0",
"@mui/icons-material": "^5.0.3",
"@mui/material": "^5.0.3",
"@tauri-apps/api": "^1.0.0-beta.8",
"@tauri-apps/api": "^1.0.0-rc.1",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
Expand Down