From fb0319a977f320a56ea93986f55b87710226cbd4 Mon Sep 17 00:00:00 2001 From: xueweiwujxw Date: Tue, 27 Dec 2022 20:50:23 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(src-tauri/src/app/menu.rs):?= =?UTF-8?q?=20fix=20warning=20on=20linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add `#[cfg(target_os = "macos")]` when declare titlebar and titlebar_menu --- src-tauri/src/app/menu.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src-tauri/src/app/menu.rs b/src-tauri/src/app/menu.rs index 8cf63eb..7b3454a 100644 --- a/src-tauri/src/app/menu.rs +++ b/src-tauri/src/app/menu.rs @@ -29,6 +29,7 @@ pub fn init() -> Menu { let stay_on_top = CustomMenuItem::new("stay_on_top".to_string(), "Stay On Top").accelerator("CmdOrCtrl+T"); + #[cfg(target_os = "macos")] let titlebar = CustomMenuItem::new("titlebar".to_string(), "Titlebar").accelerator("CmdOrCtrl+B"); let theme_light = CustomMenuItem::new("theme_light".to_string(), "Light"); @@ -40,6 +41,7 @@ pub fn init() -> Menu { } else { stay_on_top }; + #[cfg(target_os = "macos")] let titlebar_menu = if chat_conf.titlebar { titlebar.selected() } else {