Skip to content

Commit e5e1a15

Browse files
committed
Minor improvements
1 parent 7d07bbf commit e5e1a15

File tree

6 files changed

+43
-36
lines changed

6 files changed

+43
-36
lines changed

PicView/Fields.cs

-6
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,6 @@ internal static class Fields
9999
internal static bool dialogOpen;
100100
internal static bool unsupported;
101101

102-
/// <summary>
103-
/// Used to prevent overlapping in PicGallery 2
104-
/// and as a comfortable space for standard viewing
105-
/// </summary>
106-
internal const int ComfySpace = 520;
107-
108102
/// <summary>
109103
/// Backup of Width data
110104
/// </summary>

PicView/Image Logic/Resize_and_Zoom.cs

+17-9
Original file line numberDiff line numberDiff line change
@@ -437,20 +437,21 @@ internal static void TryZoomFit(string source)
437437
internal static void ZoomFit(double width, double height)
438438
{
439439
double maxWidth, maxHeight;
440-
var interfaceHeight = 90;
440+
int verticalPadding = 90;
441+
int horizontalPadding = 520;
441442

442443
if (FitToWindow)
443444
{
444445
/// Get max width and height, based on user's screen
445446
if (Properties.Settings.Default.ShowInterface)
446447
{
447-
maxWidth = Math.Min(MonitorInfo.Width - ComfySpace, width);
448-
maxHeight = Math.Min(MonitorInfo.Height - interfaceHeight, height);
448+
maxWidth = Math.Min(MonitorInfo.Width - horizontalPadding, width);
449+
maxHeight = Math.Min(MonitorInfo.Height - verticalPadding, height);
449450
}
450451
/// - 2 for window border
451452
else
452453
{
453-
maxWidth = Math.Min(MonitorInfo.Width - ComfySpace - 2, width - 2);
454+
maxWidth = Math.Min(MonitorInfo.Width - horizontalPadding - 2, width - 2);
454455
maxHeight = Math.Min(MonitorInfo.Height - 2, height - 2);
455456
}
456457
}
@@ -461,7 +462,7 @@ internal static void ZoomFit(double width, double height)
461462

462463
if (Properties.Settings.Default.ShowInterface)
463464
{
464-
maxHeight = Math.Min(mainWindow.Height - interfaceHeight, height);
465+
maxHeight = Math.Min(mainWindow.Height - verticalPadding, height);
465466
}
466467
else
467468
{
@@ -473,13 +474,20 @@ internal static void ZoomFit(double width, double height)
473474
{
474475
AspectRatio = Math.Min(maxWidth / width, (maxHeight / height));
475476
}
476-
else
477+
else
477478
{
478-
AspectRatio = Math.Min(MonitorInfo.Width / height, (MonitorInfo.Height - interfaceHeight) / width);
479+
// Rotated aspect ratio calculation
480+
if (FitToWindow)
481+
{
482+
AspectRatio = Math.Min(MonitorInfo.Width / height, (MonitorInfo.Height - verticalPadding) / width);
483+
}
484+
else
485+
{
486+
AspectRatio = Math.Min(mainWindow.Width / height, (mainWindow.Height - verticalPadding) / width);
487+
}
488+
479489
}
480490

481-
482-
483491
if (IsScrollEnabled)
484492
{
485493
/// Calculate height based on width

PicView/Image Logic/Rotate_and_Flip.cs

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ internal static void Rotate(int r)
3434
{
3535
mainWindow.img.LayoutTransform = rt;
3636
}
37-
38-
3937
}
4038

4139
/// <summary>

PicView/Interface Logic/Resources/SvgIcons.cs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ internal static class SvgIcons
88
internal const string SVGiconCamera = "M448 405.333V106.667C448 83.198 428.802 64 405.333 64H106.667C83.198 64 64 83.198 64 106.667v298.666C64 428.802 83.198 448 106.667 448h298.666C428.802 448 448 428.802 448 405.333zM181.333 288l53.334 64 74.666-96 96 128H106.667l74.666-96z";
99
internal const string SVGiconCopy = "M1696 384q40 0 68 28t28 68v1216q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-288h-544q-40 0-68-28t-28-68v-672q0-40 20-88t48-76l408-408q28-28 76-48t88-20h416q40 0 68 28t28 68v328q68-40 128-40h416zm-544 213l-299 299h299v-299zm-640-384l-299 299h299v-299zm196 647l316-316v-416h-384v416q0 40-28 68t-68 28h-416v640h512v-256q0-40 20-88t48-76zm956 804v-1152h-384v416q0 40-28 68t-68 28h-416v640h896z";
1010
//internal const string InfiniteIconSVG = "M434.7 188c-18.8-18-43.8-28-70.5-28-26.6 0-51.6 9.9-70.4 27.9l-17.6 15.9 33.1 32.1 17-15.4.1-.1c10.1-9.6 23.5-15 37.7-15 14.2 0 27.6 5.3 37.7 14.9 10 9.6 15.4 22.3 15.4 35.8 0 13.5-5.5 26.1-15.4 35.6-10.1 9.6-23.5 15-37.7 15s-27.6-5.3-37.7-14.9L218.2 188c-18.9-18-43.9-28-70.4-28-26.7 0-51.7 9.9-70.5 28C58.4 206.1 48 230.2 48 256c0 25.7 10.4 49.9 29.3 68 18.8 18 43.8 28 70.5 28 26.7 0 51.7-9.9 70.4-28l37.8-36.1 37.7 36.1c18.9 18 43.9 28 70.4 28 26.7 0 51.7-9.9 70.4-27.9 19-18.1 29.4-42.2 29.4-68 .1-25.8-10.3-50-29.2-68.1zM185.5 291.7c-10.1 9.6-23.5 15-37.7 15-14.2 0-27.6-5.3-37.7-14.9-10-9.6-15.4-22.3-15.4-35.8 0-13.5 5.5-26.1 15.4-35.6 10.1-9.6 23.5-15 37.7-15 14.2 0 27.6 5.3 37.7 14.9l37.4 35.8-37.4 35.6z";
11+
//internal const string SVGiconGithub = "M256,32C132.3,32,32,134.9,32,261.7c0,101.5,64.2,187.5,153.2,217.9a17.56,17.56,0,0,0,3.8.4c8.3,0,11.5-6.1,11.5-11.4,0-5.5-.2-19.9-.3-39.1a102.4,102.4,0,0,1-22.6,2.7c-43.1,0-52.9-33.5-52.9-33.5-10.2-26.5-24.9-33.6-24.9-33.6-19.5-13.7-.1-14.1,1.4-14.1h.1c22.5,2,34.3,23.8,34.3,23.8,11.2,19.6,26.2,25.1,39.6,25.1a63,63,0,0,0,25.6-6c2-14.8,7.8-24.9,14.2-30.7-49.7-5.8-102-25.5-102-113.5,0-25.1,8.7-45.6,23-61.6-2.3-5.8-10-29.2,2.2-60.8a18.64,18.64,0,0,1,5-.5c8.1,0,26.4,3.1,56.6,24.1a208.21,208.21,0,0,1,112.2,0c30.2-21,48.5-24.1,56.6-24.1a18.64,18.64,0,0,1,5,.5c12.2,31.6,4.5,55,2.2,60.8,14.3,16.1,23,36.6,23,61.6,0,88.2-52.4,107.6-102.3,113.3,8,7.1,15.2,21.1,15.2,42.5,0,30.7-.3,55.5-.3,63,0,5.4,3.1,11.5,11.4,11.5a19.35,19.35,0,0,0,4-.4C415.9,449.2,480,363.1,480,261.7,480,134.9,379.7,32,256,32Z";
1112

1213
// http://www.zondicons.com/
1314
internal const string SVGiconScissor = "M9.77 11.5l5.34 3.91c.44.33 1.24.59 1.79.59H20L6.89 6.38A3.5 3.5 0 1 0 5.5 8.37L7.73 10 5.5 11.63a3.5 3.5 0 1 0 1.38 1.99l2.9-2.12zM3.5 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM15.1 4.59A3.53 3.53 0 0 1 16.9 4H20l-7.5 5.5L10.45 8l4.65-3.41z";

PicView/PicVIew.csproj

+3-6
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@
9292
</PropertyGroup>
9393
<ItemGroup>
9494
<None Remove="PicGallery\PicGalleryLogic.cs~RF57f3b96.TMP" />
95-
<None Include="..\LICENSE.txt">
96-
<Pack>True</Pack>
97-
<PackagePath></PackagePath>
98-
</None>
9995
</ItemGroup>
10096
<ItemGroup>
10197
<Resource Include="Resources\fonts\Aller_Rg.ttf" />
@@ -194,12 +190,13 @@
194190
<PropertyGroup>
195191
<PostBuildEvent>
196192
</PostBuildEvent>
197-
<FileVersion>0.9.7.7</FileVersion>
193+
<FileVersion>0.9.8.0</FileVersion>
198194
<SignAssembly>false</SignAssembly>
199-
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
195+
<PackageLicenseFile></PackageLicenseFile>
200196
<Copyright>Ruben Hyldgaard Negendahl</Copyright>
201197
<PackageProjectUrl>https://github.com/Ruben2776/PicView</PackageProjectUrl>
202198
<RepositoryUrl>https://github.com/Ruben2776/PicView</RepositoryUrl>
199+
<PackageLicenseExpression>GPL-3.0</PackageLicenseExpression>
203200
</PropertyGroup>
204201
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
205202
<PropertyGroup>

PicView/Windows/Info.xaml

+22-13
Original file line numberDiff line numberDiff line change
@@ -877,19 +877,28 @@
877877

878878
<StackPanel Margin="0,70,0,0">
879879

880-
<TextBlock
881-
x:Name="GitHub"
882-
FontFamily="/PicView;component/Resources/fonts/#Aller"
883-
FontSize="14"
884-
TextAlignment="Center"
885-
ToolTip="https://github.com/Ruben2776/PicView">
886-
<Hyperlink NavigateUri="https://github.com/Ruben2776/PicView" RequestNavigate="Hyperlink_RequestNavigate">
887-
Github directory
888-
<Hyperlink.Foreground>
889-
<SolidColorBrush x:Name="GitHubBrush" Color="{StaticResource MainColor}" />
890-
</Hyperlink.Foreground>
891-
</Hyperlink>
892-
</TextBlock>
880+
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
881+
<TextBlock
882+
x:Name="GitHub"
883+
FontFamily="/PicView;component/Resources/fonts/#Aller"
884+
FontSize="14"
885+
TextAlignment="Center"
886+
ToolTip="https://github.com/Ruben2776/PicView">
887+
<Hyperlink NavigateUri="https://github.com/Ruben2776/PicView" RequestNavigate="Hyperlink_RequestNavigate">
888+
Github directory
889+
<Hyperlink.Foreground>
890+
<SolidColorBrush x:Name="GitHubBrush" Color="{StaticResource MainColor}" />
891+
</Hyperlink.Foreground>
892+
</Hyperlink>
893+
</TextBlock>
894+
<Path
895+
Width="16"
896+
Height="16"
897+
Margin="3,0,0,0"
898+
Data="M256,32C132.3,32,32,134.9,32,261.7c0,101.5,64.2,187.5,153.2,217.9a17.56,17.56,0,0,0,3.8.4c8.3,0,11.5-6.1,11.5-11.4,0-5.5-.2-19.9-.3-39.1a102.4,102.4,0,0,1-22.6,2.7c-43.1,0-52.9-33.5-52.9-33.5-10.2-26.5-24.9-33.6-24.9-33.6-19.5-13.7-.1-14.1,1.4-14.1h.1c22.5,2,34.3,23.8,34.3,23.8,11.2,19.6,26.2,25.1,39.6,25.1a63,63,0,0,0,25.6-6c2-14.8,7.8-24.9,14.2-30.7-49.7-5.8-102-25.5-102-113.5,0-25.1,8.7-45.6,23-61.6-2.3-5.8-10-29.2,2.2-60.8a18.64,18.64,0,0,1,5-.5c8.1,0,26.4,3.1,56.6,24.1a208.21,208.21,0,0,1,112.2,0c30.2-21,48.5-24.1,56.6-24.1a18.64,18.64,0,0,1,5,.5c12.2,31.6,4.5,55,2.2,60.8,14.3,16.1,23,36.6,23,61.6,0,88.2-52.4,107.6-102.3,113.3,8,7.1,15.2,21.1,15.2,42.5,0,30.7-.3,55.5-.3,63,0,5.4,3.1,11.5,11.4,11.5a19.35,19.35,0,0,0,4-.4C415.9,449.2,480,363.1,480,261.7,480,134.9,379.7,32,256,32Z"
899+
Fill="{StaticResource MainColorBrush}"
900+
Stretch="Fill" />
901+
</StackPanel>
893902

894903
<TextBlock
895904
Margin="0,2"

0 commit comments

Comments
 (0)