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

Bug fix/macos keyboard shortcuts #896

Merged
merged 5 commits into from
Nov 18, 2021
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ v6-topology.json
/explorer/downloads/topology.json
/explorer/public/downloads/mixmining.json
/explorer/public/downloads/topology.json
/nym-wallet/dist/*
/clients/validator/examples/nym-driver-example/current-contract.txt
validator-api/v4.json
validator-api/v6.json
Expand Down
43 changes: 0 additions & 43 deletions nym-wallet/dist/a2b6c8482b7be5e63d4d3a6ea073c038.svg

This file was deleted.

Binary file removed nym-wallet/dist/assets/favicon.ico
Binary file not shown.
Binary file not shown.
9 changes: 0 additions & 9 deletions nym-wallet/dist/index.html

This file was deleted.

5,778 changes: 0 additions & 5,778 deletions nym-wallet/dist/main.js

This file was deleted.

12 changes: 4 additions & 8 deletions nym-wallet/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@

use mixnet_contract::{Gateway, MixNode};
use std::sync::Arc;
use tauri::{Menu, MenuItem};
use tauri::{Menu};
use tokio::sync::RwLock;
use validator_client::nymd::fee_helpers::Operation;

mod coin;
mod config;
mod error;
mod menu;
mod operations;
mod state;
mod utils;

use crate::menu::AddDefaultSubmenus;
use crate::operations::account::*;
use crate::operations::admin::*;
use crate::operations::bond::*;
Expand All @@ -35,12 +37,6 @@ macro_rules! format_err {
};
}

pub fn create_menu_items() -> Menu {
Menu::new()
.add_native_item(MenuItem::Copy)
.add_native_item(MenuItem::Paste)
}

fn main() {
tauri::Builder::default()
.manage(Arc::new(RwLock::new(State::default())))
Expand All @@ -64,7 +60,7 @@ fn main() {
update_state_params,
get_reverse_mix_delegations_paged,
])
.menu(create_menu_items())
.menu(Menu::new().add_default_app_submenu_if_macos())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
Expand Down
25 changes: 25 additions & 0 deletions nym-wallet/src-tauri/src/menu.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use tauri::{Menu, MenuItem, Submenu};

pub trait AddDefaultSubmenus {
fn add_default_app_submenu_if_macos(self) -> Self;
}

impl AddDefaultSubmenus for Menu {
fn add_default_app_submenu_if_macos(self) -> Menu {
#[cfg(target_os = "macos")]
return self.add_submenu(Submenu::new(
"Menu",
Menu::new()
.add_native_item(MenuItem::Copy)
.add_native_item(MenuItem::Cut)
.add_native_item(MenuItem::Paste)
.add_native_item(MenuItem::Hide)
.add_native_item(MenuItem::HideOthers)
.add_native_item(MenuItem::SelectAll)
.add_native_item(MenuItem::ShowAll)
.add_native_item(MenuItem::Quit),
));
#[cfg(not(target_os = "macos"))]
return self;
}
}
2 changes: 1 addition & 1 deletion nym-wallet/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"bundle": {
"active": true,
"targets": "all",
"identifier": "com.tauri.dev",
"identifier": "com.nymwallet.nymtech",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
Expand Down