Przeglądaj źródła

Add `SideBySide` to Keybindings window. Rename `ShowSideBySide` -> `SideBySide` #89

Ruben 1 rok temu
rodzic
commit
7cd4fc15f4

+ 3 - 3
src/PicView.Avalonia/UI/FunctionsHelper.cs

@@ -115,7 +115,7 @@ public static class FunctionsHelper
 
             // Misc
             "ChangeBackground" => ChangeBackground,
-            "ShowSideBySide" => ShowSideBySide,
+            "SideBySide" => SideBySide,
             "GalleryClick" => GalleryClick,
             "Slideshow" => Slideshow,
             "ColorPicker" => ColorPicker,
@@ -805,9 +805,9 @@ public static class FunctionsHelper
         await SettingsHelper.SaveSettingsAsync();
     }
     
-    public static async Task ShowSideBySide()
+    public static async Task SideBySide()
     {
-        await UIHelper.ShowSideBySide(Vm);
+        await UIHelper.SideBySide(Vm);
     }
     
     public static async Task Reload()

+ 1 - 1
src/PicView.Avalonia/UI/UIHelper.cs

@@ -148,7 +148,7 @@ namespace PicView.Avalonia.UI
 
         #region Settings
 
-        public static async Task ShowSideBySide(MainViewModel vm)
+        public static async Task SideBySide(MainViewModel vm)
         {
             if (vm is null)
             {

+ 1 - 1
src/PicView.Avalonia/ViewModels/MainViewModel.cs

@@ -1777,7 +1777,7 @@ public class MainViewModel : ViewModelBase
         
         ChangeBackgroundCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ChangeBackground);
         
-        ShowSideBySideCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ShowSideBySide);
+        ShowSideBySideCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.SideBySide);
 
         #endregion Image commands
 

+ 27 - 6
src/PicView.Avalonia/Views/ShortcutsView.axaml

@@ -16,19 +16,19 @@
     </Design.DataContext>
     <StackPanel Margin="5,0,2,25">
         <TextBlock
-            x:Name="ApplicationShortcutsTextBlock"
             Classes="txt"
             FontFamily="/Assets/Fonts/Roboto-Bold.ttf#Roboto"
             FontSize="16"
             Margin="10,20,10,15"
             Text="{CompiledBinding ApplicationShortcuts}"
-            TextAlignment="Center" />
+            TextAlignment="Center"
+            x:Name="ApplicationShortcutsTextBlock" />
         <TextBlock
-            x:Name="ChangeKeybindingTextBlock"
             Classes="txt"
             FontFamily="/Assets/Fonts/Roboto-Bold.ttf#Roboto"
             Text="{CompiledBinding ChangeKeybindingText}"
-            TextAlignment="Center" />
+            TextAlignment="Center"
+            x:Name="ChangeKeybindingTextBlock" />
         <Button
             Classes="BorderStyle altHover mainBtn"
             HorizontalAlignment="Center"
@@ -38,13 +38,13 @@
         </Button>
 
         <TextBlock
-            x:Name="NavigationTextBlock"
             Classes="txt"
             FontFamily="/Assets/Fonts/Roboto-Bold.ttf#Roboto"
             FontSize="14"
             Margin="10,10,10,15"
             Text="{CompiledBinding Navigation}"
-            TextAlignment="Center" />
+            TextAlignment="Center"
+            x:Name="NavigationTextBlock" />
 
         <StackPanel Margin="15,0,10,10" Orientation="Horizontal">
             <TextBlock
@@ -519,6 +519,27 @@
             Text="{CompiledBinding ImageControl}"
             TextAlignment="Center" />
 
+        <StackPanel Margin="15,5,10,10" Orientation="Horizontal">
+            <TextBlock
+                Classes="txt"
+                FontFamily="/Assets/Fonts/Roboto-Bold.ttf#Roboto"
+                Text="{CompiledBinding SideBySide}"
+                Width="170" />
+            <customControls:KeybindTextBox
+                Background="{StaticResource SecondaryBackgroundColor}"
+                Classes="hover TStyle"
+                MethodName="SideBySide"
+                ToolTip.Tip="{CompiledBinding ChangeKeybindingTooltip}"
+                Width="140" />
+            <customControls:KeybindTextBox
+                Alt="True"
+                Background="{StaticResource SecondaryBackgroundColor}"
+                Classes="hover TStyle"
+                MethodName="SideBySide"
+                ToolTip.Tip="{CompiledBinding ChangeKeybindingTooltip}"
+                Width="140" />
+        </StackPanel>
+
         <StackPanel Margin="15,5,10,10" Orientation="Horizontal">
             <TextBlock
                 Classes="txt"