Skip to content

Commit

Permalink
Fixed opacity bug for fullscreen gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben2776 committed Jun 2, 2020
1 parent e5e1a15 commit cdae7a4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
15 changes: 10 additions & 5 deletions PicView/PicGallery/ToggleGallery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,15 @@ internal static void OpenFullscreenGallery()
fake.grid.Children.Add(picGallery);
}

picGallery.Opacity = 1;


fake.Show();
IsOpen = true;
ScrollTo();
mainWindow.Focus();

VisualStateManager.GoToElementState(picGallery, "Opacity", false);

#if DEBUG
Trace.WriteLine(nameof(picGallery) + " IsOpen = " + IsOpen + " " + nameof(OpenFullscreenGallery));
#endif
Expand All @@ -174,13 +176,16 @@ internal static void CloseContainedGallery()
galleryShortcut.Visibility = Visibility.Visible;
}

var da = new DoubleAnimation { Duration = TimeSpan.FromSeconds(.5) };

da.To = 0;
da.From = 1;
var da = new DoubleAnimation {
Duration = TimeSpan.FromSeconds(.5),
From = 1,
To = 0,
FillBehavior = FillBehavior.Stop
};
da.Completed += delegate
{
picGallery.Visibility = Visibility.Collapsed;
picGallery.Opacity = 1;
};

picGallery.BeginAnimation(UIElement.OpacityProperty, da);
Expand Down
9 changes: 3 additions & 6 deletions PicView/PicView.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@
</PropertyGroup>
<ItemGroup>
<None Remove="PicGallery\PicGalleryLogic.cs~RF57f3b96.TMP" />
<None Include="..\LICENSE.txt">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\fonts\Aller_Rg.ttf" />
Expand Down Expand Up @@ -194,12 +190,13 @@
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
<FileVersion>0.9.7.7</FileVersion>
<FileVersion>0.9.8.0</FileVersion>
<SignAssembly>false</SignAssembly>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageLicenseFile></PackageLicenseFile>
<Copyright>Ruben Hyldgaard Negendahl</Copyright>
<PackageProjectUrl>https://github.com/Ruben2776/PicView</PackageProjectUrl>
<RepositoryUrl>https://github.com/Ruben2776/PicView</RepositoryUrl>
<PackageLicenseExpression>GPL-3.0</PackageLicenseExpression>
</PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand Down

0 comments on commit cdae7a4

Please sign in to comment.