Skip to content

Commit a0ad074

Browse files
committed
New feature: key ctrl can rotate video/photo
Fix: Pressing key Z now will be handled as any other letter finding files on list More possibilities to moving zoomed image/video
1 parent 592f656 commit a0ad074

File tree

5 files changed

+28
-13
lines changed

5 files changed

+28
-13
lines changed

QuickViewFile/Controls/VideoPlayerControl.xaml.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
using QuickViewFile.Helpers;
2-
using QuickViewFile.Models;
32
using System.Windows;
43
using System.Windows.Controls;
54
using System.Windows.Controls.Primitives;
65
using System.Windows.Input;
7-
using System.Windows.Media.Effects;
86
using System.Windows.Threading;
97

108
namespace QuickViewFile.Controls
@@ -207,13 +205,13 @@ public void HandleKey(Key key)
207205
videoInWindowPlayer.Volume -= 0.1;
208206
ConfigHelper.SetVolume(videoInWindowPlayer.Volume);
209207
}
210-
else if (key == Key.Left)
208+
else if (key == Key.NumPad4)
211209
{
212210
TimeSpan actualTime = videoInWindowPlayer.Position;
213211
TimeSpan newTime = actualTime.Subtract(TimeSpan.FromSeconds(10));
214212
videoInWindowPlayer.Position = newTime;
215213
}
216-
else if (key == Key.Right)
214+
else if (key == Key.NumPad6)
217215
{
218216
TimeSpan actualTime = videoInWindowPlayer.Position;
219217
TimeSpan newTime = actualTime.Add(TimeSpan.FromSeconds(10));

QuickViewFile/Controls/ZoomableImage.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ private void Image_MouseMove(object sender, MouseEventArgs e)
152152
if (lastDragPoint.HasValue && IsMouseCaptured)
153153
{
154154
double multiplier;
155-
if (currentScale > 2.0)
156-
multiplier = 2;
155+
if (currentScale > 4)
156+
multiplier = 4.0;
157157
else if (currentScale > 1.0)
158-
multiplier = currentScale;
158+
multiplier = Math.Round(currentScale, 1);
159159
else
160160
multiplier = 1.0;
161161

QuickViewFile/Controls/ZoomableMediaElement.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ private void Image_MouseMove(object sender, MouseEventArgs e)
127127
if (lastDragPoint.HasValue && IsMouseCaptured)
128128
{
129129
double multiplier;
130-
if (currentScale > 2.0)
131-
multiplier = 2;
130+
if (currentScale > 4)
131+
multiplier = 4.0;
132132
else if (currentScale > 1.0)
133-
multiplier = currentScale;
133+
multiplier = Math.Round(currentScale, 1);
134134
else
135135
multiplier = 1.0;
136136

QuickViewFile/MainWindow.xaml.cs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public partial class MainWindow : Window
1717
private bool _filesListViewVisible = true;
1818
private readonly ConfigModel _config;
1919
private GridLength _filesListColumnWidthCache;
20+
private int degreesRotation = 0;
21+
public FilesListViewModel vm;
2022

2123
public MainWindow()
2224
{
@@ -60,7 +62,7 @@ public MainWindow()
6062
string fileToSelectFullPath = args.ElementAt(1);
6163
if (File.Exists(fileToSelectFullPath))
6264
{
63-
FilesListViewModel vm = new FilesListViewModel(fileToSelectFullPath);
65+
vm = new FilesListViewModel(fileToSelectFullPath);
6466
DataContext = vm;
6567
}
6668
}
@@ -209,7 +211,22 @@ private void AppWindow_KeyDown(object sender, KeyEventArgs e)
209211
e.Handled = true;
210212
}
211213
}
212-
if (e.Key > Key.D0 && e.Key < Key.Z)
214+
215+
if (e.Key == Key.LeftCtrl || e.Key == Key.RightCtrl)
216+
{
217+
degreesRotation += 90;
218+
if (degreesRotation < 360)
219+
{
220+
GridFileContent.LayoutTransform = new RotateTransform(degreesRotation);
221+
}
222+
else
223+
{
224+
degreesRotation = 0;
225+
GridFileContent.LayoutTransform = new RotateTransform(0);
226+
}
227+
}
228+
229+
if (e.Key >= Key.A && e.Key <= Key.Z)
213230
{
214231
char ASCIINumberWhichUserWantToSelect = e.Key.ToString()[0];
215232

QuickViewFile/QuickViewFile.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<UseWPF>true</UseWPF>
9-
<Version>1.7.2.3</Version>
9+
<Version>1.7.2.4</Version>
1010
<ApplicationIcon>QuickViewFile.ico</ApplicationIcon>
1111
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
1212
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>

0 commit comments

Comments
 (0)