mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
fix: popup running animation did not update after switch back from another page
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
b4f1f35e67
commit
2698427cd0
2 changed files with 15 additions and 6 deletions
|
@ -38,6 +38,12 @@ namespace SourceGit.ViewModels
|
||||||
IgnoreInaccessible = true,
|
IgnoreInaccessible = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Make sure this task takes at least 0.5s to avoid that the popup panel do not disappear very quickly.
|
||||||
|
var remain = 500 - (int)watch.Elapsed.TotalMilliseconds;
|
||||||
|
watch.Stop();
|
||||||
|
if (remain > 0)
|
||||||
|
Task.Delay(remain).Wait();
|
||||||
|
|
||||||
Dispatcher.UIThread.Invoke(() =>
|
Dispatcher.UIThread.Invoke(() =>
|
||||||
{
|
{
|
||||||
var normalizedRoot = rootDir.FullName.Replace("\\", "/");
|
var normalizedRoot = rootDir.FullName.Replace("\\", "/");
|
||||||
|
@ -61,12 +67,6 @@ namespace SourceGit.ViewModels
|
||||||
Welcome.Instance.Refresh();
|
Welcome.Instance.Refresh();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Make sure this task takes at least 0.5s to avoid that the popup panel do not disappear very quickly.
|
|
||||||
var remain = 500 - (int)watch.Elapsed.TotalMilliseconds;
|
|
||||||
watch.Stop();
|
|
||||||
if (remain > 0)
|
|
||||||
Task.Delay(remain).Wait();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,15 @@ namespace SourceGit.Views
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnLoaded(RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnLoaded(e);
|
||||||
|
|
||||||
|
_isUnloading = false;
|
||||||
|
if (IsVisible)
|
||||||
|
StartAnim();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnUnloaded(RoutedEventArgs e)
|
protected override void OnUnloaded(RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
_isUnloading = true;
|
_isUnloading = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue