Переглянути джерело

Disable/Hide "Copy File" menu item on macOS until it is implemented.

Ruben 2 місяців тому
батько
коміт
0f8f010bf9

+ 6 - 1
src/PicView.Avalonia/Views/Gallery/GalleryItem.axaml

@@ -248,12 +248,14 @@
                     </MenuItem>
                 </MenuItem>
                 <Separator />
+
                 <MenuItem
                     Command="{CompiledBinding Tools.CopyFileCommand}"
                     CommandParameter="{CompiledBinding Path=Text,
                                                        ElementName=FileLocation}"
                     Header="{CompiledBinding Translation.CopyFile.Value,
-                                             Mode=OneWay}">
+                                             Mode=OneWay}"
+                    x:Name="CopyFileMenuItem">
                     <MenuItem.Icon>
                         <Path
                             Data="{StaticResource CopyGeometry}"
@@ -263,6 +265,7 @@
                             Width="12" />
                     </MenuItem.Icon>
                 </MenuItem>
+
                 <MenuItem Header="{CompiledBinding Translation.CopyImage.Value, Mode=OneWay}">
                     <MenuItem.Icon>
                         <Path
@@ -273,6 +276,7 @@
                             Width="12" />
                     </MenuItem.Icon>
                 </MenuItem>
+
                 <MenuItem
                     Command="{CompiledBinding Tools.CopyBase64Command}"
                     CommandParameter="{CompiledBinding Path=Text,
@@ -294,6 +298,7 @@
                             Width="12" />
                     </MenuItem.Icon>
                 </MenuItem>
+
                 <MenuItem
                     Command="{CompiledBinding Tools.DuplicateFileCommand}"
                     CommandParameter="{CompiledBinding Path=Text,

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

@@ -15,6 +15,7 @@ public partial class GalleryItem : UserControl
         if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
         {
             PrintItem.IsVisible = false;
+            CopyFileMenuItem.IsVisible = false;
         }
         GalleryContextMenu.Opened += delegate
         {

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

@@ -896,7 +896,8 @@
                 CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                    FallbackValue=''}"
                 Header="{CompiledBinding Translation.Copy.Value,
-                                         Mode=OneWay}">
+                                         Mode=OneWay}"
+                x:Name="CopyFileMenuItem">
                 <MenuItem.Icon>
                     <Path
                         Data="{StaticResource CopyGeometry}"

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

@@ -30,6 +30,7 @@ public partial class MainView : UserControl
         {
             // TODO: Add macOS support
             PrintMenuItem.IsVisible = false;
+            CopyFileMenuItem.IsVisible = false;
             
             // Move alt hover to left side on macOS and switch button order
             AltButtonsPanel.HorizontalAlignment = HorizontalAlignment.Left;