Skip to content

Commit

Permalink
Fix hiding buttons not working when interface is hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben2776 committed Mar 24, 2023
1 parent ff7b45b commit d753fd9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions PicView/Animations/FadeControls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal static class FadeControls
/// Hides/shows interface elements with a fade animation
/// </summary>
/// <param name="show"></param>
internal static async Task FadeAsync(bool show)
internal static void Fade(bool show)
{
if (Settings.Default.ShowInterface && Settings.Default.Fullscreen == false
|| GetClickArrowRight == null
Expand All @@ -33,7 +33,7 @@ internal static async Task FadeAsync(bool show)
return;
}

await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)(() =>
ConfigureWindows.GetMainWindow.Dispatcher.Invoke(DispatcherPriority.Normal, (Action)(() =>
{
if (GetCropppingTool != null)
{
Expand Down
12 changes: 6 additions & 6 deletions PicView/UILogic/HideInterfaceLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ internal static void ShowStandardInterface()
internal static void ShowMinimalInterface()
{
ShowTopandBottom(false);
ShowNavigation(true);
ShowShortcuts(true);
ShowNavigation(Properties.Settings.Default.ShowAltInterfaceButtons);
ShowShortcuts(Properties.Settings.Default.ShowAltInterfaceButtons);

Settings.Default.ShowInterface = false;

Expand Down Expand Up @@ -139,19 +139,19 @@ internal static void ShowShortcuts(bool show)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
internal static async Task Interface_MouseMove()
internal static void Interface_MouseMove()
{
await FadeAsync(true).ConfigureAwait(false);
Fade(true);
}

/// <summary>
/// Logic for mouse leave mainwindow event
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
internal static async Task Interface_MouseLeave()
internal static void Interface_MouseLeave()
{
await FadeAsync(false).ConfigureAwait(false);
Fade(false);
}
}
}
2 changes: 1 addition & 1 deletion PicView/UILogic/Timers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal static void AddTimers()
AutoReset = true,
Enabled = false
};
ActivityTimer.Elapsed += async (s, e) => await FadeAsync(false).ConfigureAwait(false);
ActivityTimer.Elapsed += async (s, e) => await Fade(false).ConfigureAwait(false);
}

internal static void PicGalleryTimerHack()
Expand Down

0 comments on commit d753fd9

Please sign in to comment.