Browse Source

macOS implement open in same window or new window

Ruben 5 months ago
parent
commit
2281b32e2e
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/PicView.Avalonia.MacOS/App.axaml.cs

+ 8 - 1
src/PicView.Avalonia.MacOS/App.axaml.cs

@@ -84,7 +84,14 @@ public class App : Application, IPlatformSpecificService, IPlatformWindowService
             // Register for macOS file opening
             Current.UrlsOpened += async (_, e) =>
             {
-                await NavigationManager.LoadPicFromStringAsync(e.Urls[0], _vm).ConfigureAwait(false);
+                if (Settings.UIProperties.OpenInSameWindow)
+                {
+                    await NavigationManager.LoadPicFromStringAsync(e.Urls[0], _vm).ConfigureAwait(false);
+                }
+                else
+                {
+                    ProcessHelper.StartNewProcess(e.Urls[0]);
+                }
             };
             Current.UrlsOpened -= handler;
         }