Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
NickeManarin committed Sep 7, 2024
2 parents eea0d53 + b33bc8c commit 22a10b4
Show file tree
Hide file tree
Showing 19 changed files with 947 additions and 236 deletions.
5 changes: 3 additions & 2 deletions ScreenToGif.Model/Enums/SupportedFFmpegVersions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ namespace ScreenToGif.Domain.Enums;

public enum SupportedFFmpegVersions
{
Version7 = -1,
Version6 = 0,
Version5,
Version4,
Version5 = 1,
Version4 = 2,
}
2 changes: 1 addition & 1 deletion ScreenToGif.Model/ScreenToGif.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<DebugType>embedded</DebugType>
<UseWPF>True</UseWPF>
<Platforms>AnyCPU;ARM64;x64;x86</Platforms>
<Version>2.41.0</Version>
<Version>2.41.1</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<UseVSHostingProcess>true</UseVSHostingProcess>
Expand Down
2 changes: 1 addition & 1 deletion ScreenToGif.Native/ScreenToGif.Native.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<UseWindowsForms>True</UseWindowsForms>
<DebugType>embedded</DebugType>
<Platforms>AnyCPU;ARM64;x64;x86</Platforms>
<Version>2.41.0</Version>
<Version>2.41.1</Version>
<SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down
2 changes: 1 addition & 1 deletion ScreenToGif.Util/ScreenToGif.Util.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<UseWPF>True</UseWPF>
<DebugType>embedded</DebugType>
<Platforms>AnyCPU;ARM64;x64;x86</Platforms>
<Version>2.41.0</Version>
<Version>2.41.1</Version>
<SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
<!--<UseWindowsForms>True</UseWindowsForms>-->
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public FfmpegMovPreset()
Pass = 2,
ConstantRateFactor = null,
PixelFormat = VideoPixelFormats.Yuv420p,
Vsync = Vsyncs.Vfr,
Vsync = Vsyncs.Cfr,
Framerate = Framerates.Custom,
CustomFramerate = 40,
BitRate = 15,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public FfmpegMp4Preset()
Pass = 2,
ConstantRateFactor = null,
PixelFormat = VideoPixelFormats.Yuv420p,
Vsync = Vsyncs.Vfr,
Vsync = Vsyncs.Cfr,
Framerate = Framerates.Custom,
CustomFramerate = 40,
BitRate = 15,
Expand Down
2 changes: 1 addition & 1 deletion ScreenToGif.ViewModel/ScreenToGif.ViewModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Nullable>disable</Nullable>
<DebugType>embedded</DebugType>
<Platforms>AnyCPU;ARM64;x64;x86</Platforms>
<Version>2.41.0</Version>
<Version>2.41.1</Version>
<SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
</PropertyGroup>
<ItemGroup>
Expand Down
41 changes: 39 additions & 2 deletions ScreenToGif/Controls/LightWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ public override void OnApplyTemplate()
if (GetTemplateChild("MainGrid") is Grid resizeGrid)
{
foreach (var element in resizeGrid.Children.OfType<Rectangle>())
{
element.PreviewMouseDown += ResizeRectangle_PreviewMouseDown;
element.PreviewStylusButtonDown += ResizeRectangle_PreviewStylusButtonDown;
}
}

base.OnApplyTemplate();
Expand Down Expand Up @@ -216,7 +219,41 @@ private void ResizeRectangle_PreviewMouseDown(object sender, MouseButtonEventArg
if (e.ChangedButton != MouseButton.Left)
return;

if (!(sender is Rectangle rectangle))
if (sender is not Rectangle rectangle)
return;

switch (rectangle.Name)
{
case "TopRectangle":
ResizeWindow(ResizeDirection.Top);
break;
case "BottomRectangle":
ResizeWindow(ResizeDirection.Bottom);
break;
case "LeftRectangle":
ResizeWindow(ResizeDirection.Left);
break;
case "RightRectangle":
ResizeWindow(ResizeDirection.Right);
break;
case "TopLeftRectangle":
ResizeWindow(ResizeDirection.TopLeft);
break;
case "TopRightRectangle":
ResizeWindow(ResizeDirection.TopRight);
break;
case "BottomLeftRectangle":
ResizeWindow(ResizeDirection.BottomLeft);
break;
case "BottomRightRectangle":
ResizeWindow(ResizeDirection.BottomRight);
break;
}
}

private void ResizeRectangle_PreviewStylusButtonDown(object sender, StylusButtonEventArgs e)
{
if (sender is not Rectangle rectangle)
return;

switch (rectangle.Name)
Expand Down Expand Up @@ -250,7 +287,7 @@ private void ResizeRectangle_PreviewMouseDown(object sender, MouseButtonEventArg

private static void IsFollowing_PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (!(d is LightWindow win))
if (d is not LightWindow win)
return;

win.OnFollowingChanged();
Expand Down
4 changes: 2 additions & 2 deletions ScreenToGif/Resources/Commands.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@

<RoutedUICommand x:Key="Command.MoveLeft" Text="S.Command.MoveLeft">
<RoutedUICommand.InputGestures>
<KeyGesture>Ctrl + Shift + Left</KeyGesture>
<KeyGesture>Ctrl + Alt + Left</KeyGesture>
</RoutedUICommand.InputGestures>
</RoutedUICommand>

<RoutedUICommand x:Key="Command.MoveRight" Text="S.Command.MoveRight">
<RoutedUICommand.InputGestures>
<KeyGesture>Ctrl + Shift + Right</KeyGesture>
<KeyGesture>Ctrl + Alt + Right</KeyGesture>
</RoutedUICommand.InputGestures>
</RoutedUICommand>

Expand Down
Loading

0 comments on commit 22a10b4

Please sign in to comment.