Skip to content

Portable Tool for an Ideal Windows Setup

restoration of system window behaviors

Greedeksfb257d4692e2
diff --git a/.Source/GTweak/Windows/LoadingWindow.xaml b/.Source/GTweak/Windows/LoadingWindow.xaml
index 51988445..909162e3 100644
--- a/.Source/GTweak/Windows/LoadingWindow.xaml
+++ b/.Source/GTweak/Windows/LoadingWindow.xaml
@@ -5,12 +5,13 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:GTweak.Core.ViewModel"
xmlns:uc="clr-namespace:GTweak.Assets.UserControl"
+ xmlns:in="clr-namespace:GTweak.Utilities.Interop"
xmlns:local="clr-namespace:GTweak.Windows"
mc:Ignorable="d"
- Title="GTweak" WindowStyle="None"
+ Title="GTweak" WindowStyle="None" in:WindowStyleHelper.EnableSystemAnimations="True"
Height="260" Width="260" Background="Transparent" AllowsTransparency="True" WindowStartupLocation="CenterScreen"
ResizeMode="CanMinimize" SnapsToDevicePixels="True" UseLayoutRounding="True"
- IsTabStop="False" Opacity="0.98" ContentRendered="Window_ContentRendered" Closing="Window_Closing" Loaded="Window_Loaded">
+ IsTabStop="False" Opacity="0.98" ContentRendered="Window_ContentRendered">
<Window.DataContext>
<vm:MainViewModel/>
</Window.DataContext>
diff --git a/.Source/GTweak/Windows/LoadingWindow.xaml.cs b/.Source/GTweak/Windows/LoadingWindow.xaml.cs
index 3d436ab5..b7501995 100644
--- a/.Source/GTweak/Windows/LoadingWindow.xaml.cs
+++ b/.Source/GTweak/Windows/LoadingWindow.xaml.cs
@@ -7,7 +7,6 @@ using System;
using System.ComponentModel;
using System.Threading;
using System.Threading.Tasks;
-using System.Windows;
namespace GTweak.Windows
{
@@ -28,8 +27,9 @@ namespace GTweak.Windows
{
new TypewriterAnimation((string)FindResource("step7_load"), TextLoad, TimeSpan.FromMilliseconds(300));
await Task.Delay(400);
- Close();
+ Hide();
new MainWindow().Show();
+ Close();
};
backgroundWorker.RunWorkerAsync();
}
@@ -71,14 +71,5 @@ namespace GTweak.Windows
if (index > 0)
new TypewriterAnimation((string)FindResource($"step{++index}_load"), TextLoad, TimeSpan.FromMilliseconds(200));
}
-
- private void Window_Closing(object sender, CancelEventArgs e)
- {
- Closing -= Window_Closing;
- e.Cancel = true;
- BeginAnimation(OpacityProperty, FactoryAnimation.CreateTo(0.1, () => { Close(); }));
- }
-
- private void Window_Loaded(object sender, RoutedEventArgs e) => BeginAnimation(OpacityProperty, FactoryAnimation.CreateIn(0, 1, 0.1));
}
}
diff --git a/.Source/GTweak/Windows/MessageWindow.xaml b/.Source/GTweak/Windows/MessageWindow.xaml
index e3f53cfb..7432ec8a 100644
--- a/.Source/GTweak/Windows/MessageWindow.xaml
+++ b/.Source/GTweak/Windows/MessageWindow.xaml
@@ -6,7 +6,7 @@
xmlns:in="clr-namespace:GTweak.Utilities.Interop"
xmlns:local="clr-namespace:GTweak.Windows"
mc:Ignorable="d"
- Title="GTweak" WindowStyle="None" Loaded="Window_Loaded" Closing="Window_Closing"
+ Title="GTweak" WindowStyle="None" in:WindowStyleHelper.EnableSystemAnimations="True"
Height="170" Width="370" ResizeMode="NoResize" SnapsToDevicePixels="True" UseLayoutRounding="True" Background="Transparent" AllowsTransparency="True"
WindowStartupLocation="CenterScreen" Topmost="True" ShowInTaskbar="False" IsTabStop="False">
<Window.Clip>
diff --git a/.Source/GTweak/Windows/MessageWindow.xaml.cs b/.Source/GTweak/Windows/MessageWindow.xaml.cs
index 308387a7..6e364312 100644
--- a/.Source/GTweak/Windows/MessageWindow.xaml.cs
+++ b/.Source/GTweak/Windows/MessageWindow.xaml.cs
@@ -1,7 +1,5 @@
-using GTweak.Utilities.Animation;
-using GTweak.Utilities.Managers;
+using GTweak.Utilities.Managers;
using System;
-using System.ComponentModel;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Input;
@@ -39,14 +37,5 @@ namespace GTweak.Windows
if (e.LeftButton == MouseButtonState.Pressed)
Application.Current.Shutdown();
}
-
- private void Window_Closing(object sender, CancelEventArgs e)
- {
- Closing -= Window_Closing;
- e.Cancel = true;
- BeginAnimation(OpacityProperty, FactoryAnimation.CreateTo(0.1, () => { _timer.Stop(); Close(); }));
- }
-
- private void Window_Loaded(object sender, RoutedEventArgs e) => BeginAnimation(OpacityProperty, FactoryAnimation.CreateIn(0, 1, 0.2));
}
}