From a7436f660fc38482ee15a980d9dea13f2c39a354 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 16 Oct 2024 17:41:47 +0200 Subject: [PATCH] macOS: Add support for reloading the preview via cmd+r --- tools/lsp/preview/native.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/lsp/preview/native.rs b/tools/lsp/preview/native.rs index 48b1d6c78dc..34bf80551af 100644 --- a/tools/lsp/preview/native.rs +++ b/tools/lsp/preview/native.rs @@ -270,7 +270,8 @@ pub fn send_message_to_lsp(message: PreviewToLspMessage) { // as the life-cycle of this process is determined by the editor. The returned menuitem must // be kept alive for the duration of the event loop, as otherwise muda crashes. #[cfg(target_vendor = "apple")] -fn init_apple_platform() -> Result { +fn init_apple_platform( +) -> Result<(muda::MenuItem, muda::MenuItem), i_slint_core::api::PlatformError> { use i_slint_backend_winit::winit; use muda::{accelerator, Menu, MenuItem, PredefinedMenuItem, Submenu}; use winit::platform::macos::EventLoopBuilderExtMacOS; @@ -293,6 +294,14 @@ fn init_apple_platform() -> Result Result Result