mirror of
https://github.com/cinnyapp/cinny-desktop.git
synced 2025-01-29 17:28:26 +00:00
Fix copy-paste not working on macOS
This commit is contained in:
parent
912d7394ab
commit
1ecdddde26
|
@ -3,8 +3,16 @@
|
|||
windows_subsystem = "windows"
|
||||
)]
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
mod menu;
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
let builder = tauri::Builder::default();
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
let builder = builder.menu(menu::menu());
|
||||
|
||||
builder
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
}
|
41
src-tauri/src/menu.rs
Normal file
41
src-tauri/src/menu.rs
Normal file
|
@ -0,0 +1,41 @@
|
|||
use tauri::{AboutMetadata, Menu, MenuItem, Submenu};
|
||||
//for macOS
|
||||
pub(crate) fn menu() -> Menu {
|
||||
Menu::new()
|
||||
.add_submenu(Submenu::new(
|
||||
"Cinny",
|
||||
Menu::new()
|
||||
.add_native_item(MenuItem::About(
|
||||
"Cinny".to_string(),
|
||||
AboutMetadata::new(),
|
||||
))
|
||||
.add_native_item(MenuItem::Separator)
|
||||
.add_native_item(MenuItem::Hide)
|
||||
.add_native_item(MenuItem::HideOthers)
|
||||
.add_native_item(MenuItem::ShowAll)
|
||||
.add_native_item(MenuItem::Separator)
|
||||
.add_native_item(MenuItem::Quit),
|
||||
))
|
||||
.add_submenu(Submenu::new(
|
||||
"Edit",
|
||||
Menu::new()
|
||||
.add_native_item(MenuItem::Undo)
|
||||
.add_native_item(MenuItem::Redo)
|
||||
.add_native_item(MenuItem::Separator)
|
||||
.add_native_item(MenuItem::Cut)
|
||||
.add_native_item(MenuItem::Copy)
|
||||
.add_native_item(MenuItem::Paste)
|
||||
.add_native_item(MenuItem::SelectAll),
|
||||
))
|
||||
.add_submenu(Submenu::new(
|
||||
"View",
|
||||
Menu::new()
|
||||
.add_native_item(MenuItem::EnterFullScreen),
|
||||
))
|
||||
.add_submenu(Submenu::new(
|
||||
"Window",
|
||||
Menu::new()
|
||||
.add_native_item(MenuItem::Minimize)
|
||||
.add_native_item(MenuItem::Zoom),
|
||||
))
|
||||
}
|
Loading…
Reference in a new issue