Skip to content

Commit

Permalink
chore: trying to fix macos build
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Jun 24, 2024
1 parent 68de07d commit ea701e3
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ mod service;
mod tiles;
mod utils;
use std::thread;
use std::borrow::Borrow;

use std::env;

use std::path::PathBuf;
use tauri::menu::{
MenuBuilder, MenuItemBuilder, SubmenuBuilder,
};
use tauri::menu::{AboutMetadataBuilder, MenuBuilder, MenuItemBuilder, SubmenuBuilder};
use tauri::Manager;
use tauri::WebviewWindow;
use tauri::{WebviewWindowBuilder, WebviewUrl};
use tauri::{WebviewUrl, WebviewWindowBuilder};

use crate::tiles::{get_path, reload, set_mbtiles};

Expand Down Expand Up @@ -141,29 +140,32 @@ fn main() {
.plugin(tauri_plugin_fs::init())
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_fs::init())
.setup(|app| {
let mut menu_builder = MenuBuilder::new(app);
.setup(move |app| {
let mut menu_builder = MenuBuilder::new(app);
#[cfg(target_os = "macos")]
{
menu_builder = menu_builder.item(&SubmenuBuilder::new(app, &ctx.package_info().name)
.about(Some(AboutMetadataBuilder::new().build()))
.separator()
.services()
.separator()
.hide()
.hide_others()
.show_all()
.separator()
.quit()
.build()?);
menu_builder = menu_builder.item(
&SubmenuBuilder::new(app, &app.package_info().name)
.about(Some(AboutMetadataBuilder::new().build()))
.separator()
.services()
.separator()
.hide()
.hide_others()
.show_all()
.separator()
.quit()
.build()?,
);
}
let open = MenuItemBuilder::with_id("open", "Open...")
.accelerator("CmdOrControl+O")
.build(app)?;
menu_builder = menu_builder
.item(
&SubmenuBuilder::new(app, "File")
.item(&open)
.item(
&MenuItemBuilder::with_id("open", "Open...")
.accelerator("CmdOrControl+O")
.build(app)?,
)
.close_window()
.build()?,
)
Expand Down

0 comments on commit ea701e3

Please sign in to comment.