Browse Source

macOS updates

Ruben 5 months ago
parent
commit
d9765e2bc3

+ 10 - 14
src/PicView.Avalonia.MacOS/App.axaml.cs

@@ -79,21 +79,17 @@ public class App : Application, IPlatformSpecificService
             await Dispatcher.UIThread.InvokeAsync(() =>
             {
                 _mainWindow.DataContext = _vm;
-#if DEBUG
-                StartUpHelper.StartWithArguments(_vm, settingsExists, desktop, _mainWindow);
-#else
-                StartUpHelper.StartWithoutArguments(_vm, settingsExists, desktop, _mainWindow);
-#endif
+                if (startUpFilePath is not null)
+                {
+                    StartUpHelper.StartWithoutArguments(_vm, settingsExists, desktop, _mainWindow, startUpFilePath);
+                }
+                else
+                {
+                    StartUpHelper.StartWithoutArguments(_vm, settingsExists, desktop, _mainWindow);
+                }
             },DispatcherPriority.Send);
-
-            if (startUpFilePath is not null)
-            {
-                await QuickLoad.QuickLoadAsync(_vm, startUpFilePath).ConfigureAwait(false);
-            }
-            else
-            {
-                ErrorHandling.ShowStartUpMenu(_vm);
-            }
+            
+            // Register for macOS file opening
             Current.UrlsOpened += async (_, e) =>
             {
                 await NavigationManager.LoadPicFromStringAsync(e.Urls[0], _vm).ConfigureAwait(false);

+ 3 - 5
src/PicView.Avalonia.MacOS/Views/ExifWindow.axaml

@@ -173,13 +173,9 @@
                 Width="45"
                 x:Name="LocateOnDiskButton" />
 
-            <buttons:StarOutlineButtons
-                Background="{DynamicResource SecondaryButtonBackgroundColor}"
-                DockPanel.Dock="Right"
-                x:Name="StarOutlineButtons" />
+            <buttons:StarOutlineButtons DockPanel.Dock="Right" x:Name="StarOutlineButtons" />
 
             <customControls:IconButton
-                Background="{DynamicResource SecondaryButtonBackgroundColor}"
                 BorderBrush="{DynamicResource MainBorderColor}"
                 BorderThickness="0,0,1,0"
                 Classes="noBorderHover"
@@ -191,6 +187,8 @@
                 Icon="{StaticResource StarOffImage}"
                 IconHeight="17"
                 IconWidth="17"
+                ToolTip.Tip="{CompiledBinding Translation.RemoveStarRating,
+                                              Mode=OneWay}"
                 Width="35"
                 x:Name="RemoveRatingButton" />
 

+ 106 - 35
src/PicView.Avalonia.MacOS/Views/MacMainWindow.axaml

@@ -25,12 +25,12 @@
             <NativeMenuItem Header="{CompiledBinding Translation.File}">
                 <NativeMenu>
                     <NativeMenuItem Command="{CompiledBinding OpenFileCommand}" Header="{CompiledBinding Translation.Open, Mode=OneWay}" />
-                    <NativeMenuItem
-                        Command="{CompiledBinding OpenWithCommand}"
-                        CommandParameter="{CompiledBinding PicViewer.FileInfo.FullName,
-                                                           FallbackValue=''}"
-                        Header="{CompiledBinding Translation.OpenWith,
-                                                 Mode=OneWay}" />
+                    <!--  <NativeMenuItem  -->
+                    <!--  Command="{CompiledBinding OpenWithCommand}"  -->
+                    <!--  CommandParameter="{CompiledBinding PicViewer.FileInfo.FullName,  -->
+                    <!--  FallbackValue=''}"  -->
+                    <!--  Header="{CompiledBinding Translation.OpenWith,  -->
+                    <!--  Mode=OneWay}" />  -->
                     <NativeMenuItem Command="{CompiledBinding SaveFileCommand}" Header="{CompiledBinding Translation.Save, Mode=OneWay}" />
                     <NativeMenuItem Command="{CompiledBinding SaveFileAsCommand}" Header="{CompiledBinding Translation.SaveAs, Mode=OneWay}" />
                     <NativeMenuItem
@@ -38,74 +38,145 @@
                         CommandParameter="{CompiledBinding PicViewer.FileInfo,
                                                            FallbackValue=''}"
                         Header="{CompiledBinding Translation.Print,
-                                                 Mode=OneWay}" />
+                                                 Mode=OneWay}"
+                        IsEnabled="{CompiledBinding PicViewer.ImageSource,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                     <NativeMenuItem
                         Command="{CompiledBinding LocateOnDiskCommand}"
-                        CommandParameter="{CompiledBinding PicViewer.FileInfo,
+                        CommandParameter="{CompiledBinding PicViewer.FileInfo.FullName,
                                                            FallbackValue=''}"
                         Header="{CompiledBinding Translation.ShowInFolder,
-                                                 Mode=OneWay}" />
+                                                 Mode=OneWay}"
+                        IsEnabled="{CompiledBinding PicViewer.FileInfo,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                     <NativeMenuItemSeparator />
-                    <NativeMenuItem Command="{CompiledBinding DeleteFileCommand}" Header="{CompiledBinding Translation.DeleteFile, Mode=OneWay}" />
+                    <NativeMenuItem
+                        Command="{CompiledBinding DeleteFileCommand}"
+                        CommandParameter="{CompiledBinding PicViewer.FileInfo.FullName,
+                                                           FallbackValue=''}"
+                        Header="{CompiledBinding Translation.DeleteFile,
+                                                 Mode=OneWay}"
+                        IsEnabled="{CompiledBinding PicViewer.FileInfo,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                     <NativeMenuItemSeparator />
-                    <NativeMenuItem Command="{CompiledBinding ReloadCommand}" Header="{CompiledBinding Translation.Reload, Mode=OneWay}" />
+                    <NativeMenuItem
+                        Command="{CompiledBinding ReloadCommand}"
+                        CommandParameter="{CompiledBinding PicViewer.FileInfo.FullName,
+                                                           FallbackValue=''}"
+                        Header="{CompiledBinding Translation.Reload,
+                                                 Mode=OneWay}"
+                        IsEnabled="{CompiledBinding PicViewer.ImageSource,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                     <NativeMenuItem Command="{CompiledBinding NewWindowCommand}" Header="{CompiledBinding Translation.NewWindow, Mode=OneWay}" />
                     <NativeMenuItemSeparator />
-                    <NativeMenuItem Command="{CompiledBinding RenameCommand}" Header="{CompiledBinding Translation.RenameFile, Mode=OneWay}" />
+                    <NativeMenuItem
+                        Command="{CompiledBinding RenameCommand}"
+                        CommandParameter="{CompiledBinding PicViewer.FileInfo.FullName,
+                                                           FallbackValue=''}"
+                        Header="{CompiledBinding Translation.RenameFile,
+                                                 Mode=OneWay}"
+                        IsEnabled="{CompiledBinding PicViewer.FileInfo,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                     <NativeMenuItemSeparator />
                     <NativeMenuItem Command="{CompiledBinding PasteCommand}" Header="{CompiledBinding Translation.Paste, Mode=OneWay}" />
                     <NativeMenuItemSeparator />
                     <NativeMenuItem
                         Command="{CompiledBinding CopyFileCommand}"
-                        CommandParameter="{CompiledBinding PicViewer.FileInfo,
+                        CommandParameter="{CompiledBinding PicViewer.FileInfo.FullName,
                                                            FallbackValue=''}"
                         Header="{CompiledBinding Translation.CopyFile,
-                                                 Mode=OneWay}" />
-                    <NativeMenuItem Command="{CompiledBinding CopyImageCommand}" Header="{CompiledBinding Translation.CopyImage, Mode=OneWay}" />
-                    <NativeMenuItem Command="{CompiledBinding CopyFilePathCommand}" Header="{CompiledBinding Translation.FileCopyPath, Mode=OneWay}" />
+                                                 Mode=OneWay}"
+                        IsEnabled="{CompiledBinding PicViewer.FileInfo,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
+                    <NativeMenuItem
+                        Command="{CompiledBinding CopyImageCommand}"
+                        CommandParameter="{CompiledBinding PicViewer.FileInfo.FullName,
+                                                           FallbackValue=''}"
+                        Header="{CompiledBinding Translation.CopyImage,
+                                                 Mode=OneWay}"
+                        IsEnabled="{CompiledBinding PicViewer.ImageSource,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
+                    <NativeMenuItem
+                        Command="{CompiledBinding CopyFilePathCommand}"
+                        CommandParameter="{CompiledBinding PicViewer.FileInfo.FullName,
+                                                           FallbackValue=''}"
+                        Header="{CompiledBinding Translation.FileCopyPath,
+                                                 Mode=OneWay}"
+                        IsEnabled="{CompiledBinding PicViewer.FileInfo,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                     <NativeMenuItem
                         Command="{CompiledBinding DuplicateFileCommand}"
-                        CommandParameter="{CompiledBinding PicViewer.FileInfo,
+                        CommandParameter="{CompiledBinding PicViewer.FileInfo.FullName,
                                                            FallbackValue=''}"
                         Header="{CompiledBinding Translation.DuplicateFile,
-                                                 Mode=OneWay}" />
-                    <NativeMenuItem Command="{CompiledBinding CutCommand}" Header="{CompiledBinding Translation.FileCut, Mode=OneWay}" />
+                                                 Mode=OneWay}"
+                        IsEnabled="{CompiledBinding PicViewer.FileInfo,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                 </NativeMenu>
             </NativeMenuItem>
 
             <NativeMenuItem Header="{CompiledBinding Translation.Image, Mode=OneWay}">
                 <NativeMenu>
-                    <NativeMenuItem Command="{CompiledBinding RotateLeftCommand}" Header="{CompiledBinding Translation.RotateLeft, Mode=OneWay}" />
-                    <NativeMenuItem Command="{CompiledBinding RotateRightCommand}" Header="{CompiledBinding Translation.RotateRight, Mode=OneWay}" />
-                    <NativeMenuItem Command="{CompiledBinding FlipCommand}" Header="{CompiledBinding Translation.Flip, Mode=OneWay}" />
+                    <NativeMenuItem
+                        Command="{CompiledBinding RotateLeftCommand}"
+                        Header="{CompiledBinding Translation.RotateLeft,
+                                                 Mode=OneWay}"
+                        IsEnabled="{CompiledBinding PicViewer.FileInfo,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
+                    <NativeMenuItem
+                        Command="{CompiledBinding RotateRightCommand}"
+                        Header="{CompiledBinding Translation.RotateRight,
+                                                 Mode=OneWay}"
+                        IsEnabled="{CompiledBinding PicViewer.FileInfo,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
+                    <NativeMenuItem
+                        Command="{CompiledBinding FlipCommand}"
+                        Header="{CompiledBinding Translation.Flip,
+                                                 Mode=OneWay}"
+                        IsEnabled="{CompiledBinding PicViewer.FileInfo,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                     <NativeMenuItemSeparator />
-                    <NativeMenuItem Command="{CompiledBinding CropCommand}" Header="{CompiledBinding Translation.Crop, Mode=OneWay}" />
+                    <NativeMenuItem
+                        Command="{CompiledBinding CropCommand}"
+                        CommandParameter="{CompiledBinding PicViewer.FileInfo.FullName,
+                                                           FallbackValue=''}"
+                        Header="{CompiledBinding Translation.Crop,
+                                                 Mode=OneWay}"
+                        IsEnabled="{CompiledBinding PicViewer.FileInfo,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                     <NativeMenuItemSeparator />
-                    <!--  TODO Implement setting as wallpaper for macOS  -->
                     <NativeMenuItem
                         Command="{CompiledBinding SetAsWallpaperCommand}"
-                        CommandParameter="{CompiledBinding PicViewer.FileInfo,
+                        CommandParameter="{CompiledBinding PicViewer.FileInfo.FullName,
                                                            FallbackValue=''}"
                         Header="{CompiledBinding Translation.SetAsWallpaper,
                                                  Mode=OneWay}"
-                        IsEnabled="False" />
+                        IsEnabled="{CompiledBinding PicViewer.FileInfo,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
+                    <NativeMenuItemSeparator />
+                    <NativeMenuItem Command="{CompiledBinding ShowExifWindowCommand}" Header="{CompiledBinding Translation.ImageInfo, Mode=OneWay}" />
                     <NativeMenuItem
-                        Command="{CompiledBinding SetAsLockScreenCommand}"
-                        CommandParameter="{CompiledBinding PicViewer.FileInfo,
+                        Command="{CompiledBinding FilePropertiesCommand}"
+                        CommandParameter="{CompiledBinding PicViewer.FileInfo.FullName,
                                                            FallbackValue=''}"
-                        Header="{CompiledBinding Translation.SetAsLockScreenImage,
+                        Header="{CompiledBinding Translation.FileProperties,
                                                  Mode=OneWay}"
-                        IsEnabled="False" />
-                    <NativeMenuItemSeparator />
-                    <NativeMenuItem Command="{CompiledBinding ShowExifWindowCommand}" Header="{CompiledBinding Translation.ImageInfo, Mode=OneWay}" />
-                    <NativeMenuItem Header="{CompiledBinding Translation.FileProperties}" />
+                        IsEnabled="{CompiledBinding PicViewer.FileInfo,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                     <NativeMenuItemSeparator />
                     <NativeMenuItem Command="{CompiledBinding ShowSingleImageResizeWindowCommand}" Header="{CompiledBinding Translation.ResizeImage}" />
                     <NativeMenuItem Command="{CompiledBinding ShowBatchResizeWindowCommand}" Header="{CompiledBinding Translation.BatchResize}" />
                     <NativeMenuItemSeparator />
-                    <NativeMenuItem Command="{CompiledBinding OptimizeImageCommand}" Header="{CompiledBinding Translation.OptimizeImage, Mode=OneWay}" />
+                    <NativeMenuItem
+                        Command="{CompiledBinding OptimizeImageCommand}"
+                        CommandParameter="{CompiledBinding PicViewer.FileInfo.FullName,
+                                                           FallbackValue=''}"
+                        Header="{CompiledBinding Translation.OptimizeImage,
+                                                 Mode=OneWay}"
+                        IsEnabled="{CompiledBinding PicViewer.FileInfo,
+                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                     <NativeMenuItemSeparator />
-                    <NativeMenuItem Header="{CompiledBinding Translation.Effects}" />
+                    <NativeMenuItem Command="{CompiledBinding ShowEffectsWindowCommand}" Header="{CompiledBinding Translation.Effects, Mode=OneWay}" />
                 </NativeMenu>
             </NativeMenuItem>
             <NativeMenuItem Header="{CompiledBinding Translation.Navigation}">

+ 9 - 4
src/PicView.Avalonia.MacOS/Views/MacMainWindow.axaml.cs

@@ -18,12 +18,12 @@ public partial class MacMainWindow : Window
             {
                 WindowResizing.HandleWindowResize(this, size);
             });
+            if (DataContext is not MainViewModel vm)
+            {
+                return;
+            }
             this.WhenAnyValue(x => x.WindowState).Subscribe(state =>
             {
-                if (DataContext is not MainViewModel vm)
-                {
-                    return;
-                }
                 switch (state)
                 {
                     case WindowState.FullScreen:
@@ -37,6 +37,11 @@ public partial class MacMainWindow : Window
                         break;
                 }
             });
+            // Hide macOS buttons when interface is hidden
+            vm.WhenAnyValue(x => x.IsTopToolbarShown).Subscribe(shown =>
+            {
+                SystemDecorations = shown ? SystemDecorations.Full : SystemDecorations.None;
+            });
         };
     }
 

+ 16 - 17
src/PicView.Avalonia/StartUp/StartUpHelper.cs

@@ -66,17 +66,8 @@ public static class StartUpHelper
         
         InitializeSettings(vm);
         
-        if (Settings.WindowProperties.AutoFit)
-        {
-            ScreenHelper.UpdateScreenSize(window);
-            HandleAutoFit(vm, window);
-        }
-        else
-        {
-            HandleNormalWindow(vm, window);
-        }
+        HandleWindowScalingMode(vm, window);
         
-        vm.ImageViewer = new ImageViewer();
         HandleStartUpMenuOrImage(vm, args);
         window.Show();
         
@@ -84,10 +75,20 @@ public static class StartUpHelper
     }
     
         public static void StartWithoutArguments(MainViewModel vm, bool settingsExists, IClassicDesktopStyleApplicationLifetime desktop,
-        Window window)
+        Window window, string? arg = null)
     {
         InitializeSettings(vm);
         
+        HandleWindowScalingMode(vm, window);
+
+        HandleStartUpMenuOrImage(vm, arg is null ? [] : [arg]);
+        window.Show();
+        
+        HandlePostWindowUpdates(vm, settingsExists, desktop, window);
+    }
+
+    private static void HandleWindowScalingMode(MainViewModel vm, Window window)
+    {
         if (Settings.WindowProperties.AutoFit)
         {
             ScreenHelper.UpdateScreenSize(window);
@@ -97,10 +98,6 @@ public static class StartUpHelper
         {
             HandleNormalWindow(vm, window);
         }
-        window.Show();
-        vm.ImageViewer = new ImageViewer();
-        
-        HandlePostWindowUpdates(vm, settingsExists, desktop, window);
     }
 
     private static void HandlePostWindowUpdates(MainViewModel vm, bool settingsExists, IClassicDesktopStyleApplicationLifetime desktop, Window window)
@@ -188,8 +185,10 @@ public static class StartUpHelper
         }
     }
 
-    private static void HandleStartUpMenuOrImage(MainViewModel vm, string[] args)
+    public static void HandleStartUpMenuOrImage(MainViewModel vm, string[] args)
     {
+        vm.ImageViewer = new ImageViewer();
+        
         if (args.Length > 1)
         {
             vm.CurrentView = vm.ImageViewer;
@@ -202,7 +201,7 @@ public static class StartUpHelper
                 ErrorHandling.ShowStartUpMenu(vm);
                 if (Settings.WindowProperties.AutoFit)
                 {
-                    WindowFunctions.CenterWindowOnScreen();
+                    WindowFunctions.CenterWindowOnScreen(false, true);
                 }
             }
             else

+ 2 - 1
src/PicView.Avalonia/UI/HideInterfaceLogic.cs

@@ -1,4 +1,5 @@
-using Avalonia.Controls;
+using System.Runtime.InteropServices;
+using Avalonia.Controls;
 using Avalonia.Threading;
 using PicView.Avalonia.Animations;
 using PicView.Avalonia.Gallery;

+ 2 - 1
src/PicView.Avalonia/Views/MainView.axaml

@@ -104,7 +104,8 @@
                 Header="{CompiledBinding Translation.OpenWith,
                                          Mode=OneWay}"
                 IsEnabled="{CompiledBinding PicViewer.ImageSource,
-                                            Converter={x:Static ObjectConverters.IsNotNull}}">
+                                            Converter={x:Static ObjectConverters.IsNotNull}}"
+                x:Name="OpenWithMenuItem">
                 <MenuItem.Icon>
                     <Path
                         Data="{StaticResource OpenWithGeometry}"

+ 1 - 0
src/PicView.Avalonia/Views/MainView.axaml.cs

@@ -78,6 +78,7 @@ public partial class MainView : UserControl
             if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
             {
                 WallpaperMenuItem.IsVisible = false;
+                OpenWithMenuItem.IsVisible = false;
             }
             else
             {

+ 10 - 9
src/PicView.Avalonia/Views/UC/Buttons/StarOutlineButtons.axaml

@@ -17,14 +17,15 @@
         <Canvas
             PointerEntered="Star1_OnPointerEntered"
             PointerExited="Stars_OnPointerExited"
+            PointerPressed="OneStarCLick"
             Width="30">
             <Button
                 Background="Transparent"
                 Canvas.Left="5"
                 Canvas.Top="3"
-                Click="OneStarCLick"
                 Command="{Binding SetExifRating1Command}"
                 Foreground="{DynamicResource MainTextColor}"
+                ToolTip.Tip="{Binding Translation._1Star, Mode=OneWay}"
                 x:Name="Star1">
                 <Image
                     Height="20"
@@ -36,14 +37,14 @@
         <Canvas
             PointerEntered="Star2_OnPointerEntered"
             PointerExited="Stars_OnPointerExited"
+            PointerPressed="TwoStarCLick"
             Width="30">
             <Button
                 Background="Transparent"
                 Canvas.Left="3"
                 Canvas.Top="3"
-                Click="TwoStarCLick"
-                ClickMode="Release"
                 Command="{Binding SetExifRating2Command}"
+                ToolTip.Tip="{Binding Translation._2Star, Mode=OneWay}"
                 x:Name="Star2">
                 <Image
                     Height="20"
@@ -55,14 +56,14 @@
         <Canvas
             PointerEntered="Star3_OnPointerEntered"
             PointerExited="Stars_OnPointerExited"
+            PointerPressed="ThreeStarCLick"
             Width="30">
             <Button
                 Background="Transparent"
                 Canvas.Left="3"
                 Canvas.Top="3"
-                Click="ThreeStarCLick"
-                ClickMode="Release"
                 Command="{Binding SetExifRating3Command}"
+                ToolTip.Tip="{Binding Translation._3Star, Mode=OneWay}"
                 x:Name="Star3">
                 <Image
                     Height="20"
@@ -74,14 +75,14 @@
         <Canvas
             PointerEntered="Star4_OnPointerEntered"
             PointerExited="Stars_OnPointerExited"
+            PointerPressed="FourStarCLick"
             Width="30">
             <Button
                 Background="Transparent"
                 Canvas.Left="3"
                 Canvas.Top="3"
-                Click="FourStarCLick"
-                ClickMode="Release"
                 Command="{Binding SetExifRating4Command}"
+                ToolTip.Tip="{Binding Translation._4Star, Mode=OneWay}"
                 x:Name="Star4">
                 <Image
                     Height="20"
@@ -93,14 +94,14 @@
         <Canvas
             PointerEntered="Star5_OnPointerEntered"
             PointerExited="Stars_OnPointerExited"
+            PointerPressed="FiveStarCLick"
             Width="30">
             <Button
                 Background="Transparent"
                 Canvas.Left="3"
                 Canvas.Top="3"
-                Click="FiveStarCLick"
-                ClickMode="Release"
                 Command="{Binding SetExifRating5Command}"
+                ToolTip.Tip="{Binding Translation._5Star, Mode=OneWay}"
                 x:Name="Star5">
                 <Image
                     Height="20"

+ 3 - 3
src/PicView.Avalonia/WindowBehavior/WindowFunctions.cs

@@ -361,8 +361,8 @@ public static class WindowFunctions
         {
             vm.SizeToContent = SizeToContent.WidthAndHeight;
             vm.CanResize = false;
-            CenterWindowOnScreen();
             vm.IsAutoFit = true;
+            CenterWindowOnScreen();
             _ = ResizeAndFixRenderingError(vm); // Fixes incorrect render size
         }
         else
@@ -542,7 +542,7 @@ public static class WindowFunctions
 
     #region Window Size and Position
 
-    public static void CenterWindowOnScreen(bool horizontal = true)
+    public static void CenterWindowOnScreen(bool horizontal = true, bool top = false)
     {
         if (Application.Current?.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop)
         {
@@ -567,7 +567,7 @@ public static class WindowFunctions
 
             // Calculate the position to center the window on the screen
             var centeredX = x + (screen.WorkingAreaWidth - windowSize.Width) / 2;
-            var centeredY = y + (screen.WorkingAreaHeight - windowSize.Height) / 2;
+            var centeredY = y + (top ? 0 : (screen.WorkingAreaHeight - windowSize.Height) / 2);
 
             // Set the window's new position
             window.Position = horizontal

+ 3 - 1
src/PicView.Core.MacOS/MacOsKeybindings.cs

@@ -61,9 +61,11 @@ public static class MacOsKeybindings
                                                 "Alt+Z": "ToggleInterface",
                                                 "Delete": "DeleteFile",
                                                 "Shift+Delete": "DeleteFilePermanently",
+                                                "Back": "DeleteFile",
+                                                "Shift+Back": "DeleteFilePermanently",
                                                 "Cmd+N": "NewWindow",
                                                 "J": "ResizeWindow",
-                                                "Alt+Cmd+I": "ResizeWindow"
+                                                "Alt+Cmd+I": "ResizeWindow",
                                               }
                                               """;
 }