style<*>: remove Waiting panel; adjustment for high dpi screens;

This commit is contained in:
leo 2021-04-02 22:45:19 +08:00
parent 762e51de74
commit fa3ff6f2db
16 changed files with 79 additions and 103 deletions

View file

@ -9,6 +9,7 @@ using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Threading;
namespace SourceGit.UI {
@ -990,8 +991,12 @@ namespace SourceGit.UI {
AddSubmodule.Show(repo);
}
private void UpdateSubmodule(object sender, RoutedEventArgs e) {
Waiting.Show(repo, "Text.Waiting.UpdateSubmodule", () => repo.UpdateSubmodule());
private async void UpdateSubmodule(object sender, RoutedEventArgs e) {
DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
anim.RepeatBehavior = RepeatBehavior.Forever;
iconUpdateSubmodule.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
await Task.Run(() => repo.UpdateSubmodule());
iconUpdateSubmodule.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
}
private void SubmoduleLostFocus(object sender, RoutedEventArgs e) {