Skip to content

Commit 592f656

Browse files
committed
Fix font size in video
Feature: moving zoomed image or video now moves multiplied distance by current zooming scale New feature: pressing multiple times the same key on keyboard now can lookup for next file that name begins with this key
1 parent 75ad388 commit 592f656

File tree

5 files changed

+37
-10
lines changed

5 files changed

+37
-10
lines changed

QuickViewFile/Controls/VideoPlayerControl.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<local:ZoomableMediaElement x:Name="videoInWindowPlayer" LoadedBehavior="Manual" RenderOptions.BitmapScalingMode="{Binding videoQuality}"/>
2222
</Grid>
2323

24-
<StatusBar Grid.Row="1" Height="Auto">
24+
<StatusBar Grid.Row="1">
2525
<StatusBar.ItemsPanel>
2626
<ItemsPanelTemplate>
2727
<Grid>
@@ -56,13 +56,13 @@
5656
<TextBlock Name="lblProgressStatus" FontSize="12" FontWeight="Bold">00:00:00</TextBlock>
5757
</StatusBarItem>
5858
<StatusBarItem Grid.Column="4">
59-
<TextBlock Name="fullTime" FontSize="16" FontWeight="Bold">00:00:00</TextBlock>
59+
<TextBlock Name="fullTime" FontSize="12" FontWeight="Bold">00:00:00</TextBlock>
6060
</StatusBarItem>
6161
<StatusBarItem Grid.Column="5" HorizontalContentAlignment="Stretch" Height="Auto">
6262
<Slider Name="sliProgress" Focusable="False" IsManipulationEnabled="True" Thumb.DragStarted="sliProgress_DragStarted" Thumb.DragCompleted="sliProgress_DragCompleted" ValueChanged="sliProgress_ValueChanged" IsSnapToTickEnabled="True" IsMoveToPointEnabled="True" />
6363
</StatusBarItem>
6464
<StatusBarItem Grid.Column="6">
65-
<ProgressBar Name="pbVolume" Width="50" Height="12" Foreground="LightGreen" Maximum="1" Value="{Binding ElementName=videoInWindowPlayer, Path=Volume}" />
65+
<ProgressBar Name="pbVolume" Width="50" Height="10" Foreground="LightGreen" Maximum="1" Value="{Binding ElementName=videoInWindowPlayer, Path=Volume}" />
6666
</StatusBarItem>
6767
</StatusBar>
6868
</Grid>

QuickViewFile/Controls/ZoomableImage.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public ZoomableImage()
5757
transformGroup.Children.Add(scaleTransform);
5858
transformGroup.Children.Add(translateTransform);
5959

60-
ClipToBounds = true;
60+
//ClipToBounds = true;
6161

6262
RenderTransform = transformGroup;
6363

@@ -151,8 +151,16 @@ private void Image_MouseMove(object sender, MouseEventArgs e)
151151
{
152152
if (lastDragPoint.HasValue && IsMouseCaptured)
153153
{
154+
double multiplier;
155+
if (currentScale > 2.0)
156+
multiplier = 2;
157+
else if (currentScale > 1.0)
158+
multiplier = currentScale;
159+
else
160+
multiplier = 1.0;
161+
154162
Point currentPoint = e.GetPosition(this);
155-
Vector delta = Point.Subtract(currentPoint, lastDragPoint.Value);
163+
Vector delta = Point.Subtract(currentPoint, lastDragPoint.Value) * multiplier;
156164

157165
translateTransform.X += delta.X;
158166
translateTransform.Y += delta.Y;

QuickViewFile/Controls/ZoomableMediaElement.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public ZoomableMediaElement()
3636
UseLayoutRounding = true;
3737
transformGroup.Children.Add(scaleTransform);
3838
transformGroup.Children.Add(translateTransform);
39-
ClipToBounds = true;
39+
40+
//ClipToBounds = true;
4041

4142
_config = ConfigHelper.loadedConfig;
4243

@@ -125,8 +126,16 @@ private void Image_MouseMove(object sender, MouseEventArgs e)
125126
{
126127
if (lastDragPoint.HasValue && IsMouseCaptured)
127128
{
129+
double multiplier;
130+
if (currentScale > 2.0)
131+
multiplier = 2;
132+
else if (currentScale > 1.0)
133+
multiplier = currentScale;
134+
else
135+
multiplier = 1.0;
136+
128137
Point currentPoint = e.GetPosition(this);
129-
Vector delta = Point.Subtract(currentPoint, lastDragPoint.Value);
138+
Vector delta = Point.Subtract(currentPoint, lastDragPoint.Value) * multiplier;
130139

131140
translateTransform.X += delta.X;
132141
translateTransform.Y += delta.Y;

QuickViewFile/MainWindow.xaml.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public MainWindow()
2323
try
2424
{
2525
RenderOptions.SetCachingHint(this, CachingHint.Cache);
26+
this.UseLayoutRounding = true;
2627
_config = ConfigHelper.loadedConfig;
2728
RenderOptions.ProcessRenderMode = _config.RenderMode == 0 ? System.Windows.Interop.RenderMode.Default : System.Windows.Interop.RenderMode.SoftwareOnly;
2829
RenderOptions.SetEdgeMode(this, _config.EdgeMode == 1 ? EdgeMode.Aliased : EdgeMode.Unspecified);
@@ -210,16 +211,25 @@ private void AppWindow_KeyDown(object sender, KeyEventArgs e)
210211
}
211212
if (e.Key > Key.D0 && e.Key < Key.Z)
212213
{
213-
char ASCIINumberWhichUserWantToSelect = (char)((int)e.Key + 21); ///because ASCII at keyboard has code 65, in .NET A on keyboard is 44, so after adding 21 it will be this letter which user want to find
214+
char ASCIINumberWhichUserWantToSelect = e.Key.ToString()[0];
214215

215-
var itemToSelect = FilesListView.Items.Cast<QuickViewFile.Models.ItemList>()
216+
var nextItems = new ItemList();
217+
218+
var itemToSelect = FilesListView.Items.Cast<QuickViewFile.Models.ItemList>().Skip(FilesListView.SelectedIndex + 1)
216219
.FirstOrDefault(item => !string.IsNullOrEmpty(item.Name) && char.ToUpper(item.Name[0]) == ASCIINumberWhichUserWantToSelect);
220+
221+
if (itemToSelect is null) //search from beginning if not found in next items
222+
{
223+
itemToSelect = FilesListView.Items.Cast<QuickViewFile.Models.ItemList>()
224+
.FirstOrDefault(item => !string.IsNullOrEmpty(item.Name) && char.ToUpper(item.Name[0]) == ASCIINumberWhichUserWantToSelect);
225+
}
217226
if (itemToSelect is not null)
218227
{
219228
FilesListView.SelectedItem = itemToSelect;
220229
FilesListView.ScrollIntoView(itemToSelect);
221230
}
222231
}
232+
223233
if (e.Key == Key.Enter)
224234
{
225235
Application.Current.Dispatcher.BeginInvoke(async () =>

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.2</Version>
9+
<Version>1.7.2.3</Version>
1010
<ApplicationIcon>QuickViewFile.ico</ApplicationIcon>
1111
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
1212
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>

0 commit comments

Comments
 (0)