Portable Tool for an Ideal Windows Setup
C# activatorbloatware-removalcsharpdebloatdebloaterdisable-servicesmonitoring-systemportableprivacy-toolsregistry-tweakssystem-tuningsystem-utilitytelemetrytweakerwindows-10windows-11windows-debloatwindows-defenderwindows-optimizationwindows-tweaks
upd. implement adaptive window scaling for high DPI displays
Greedeks20be3ba105b0
diff --git a/.Source/GTweak/Windows/MainWindow.xaml b/.Source/GTweak/Windows/MainWindow.xamlindex 49cfa6b3..a39498b8 100644--- a/.Source/GTweak/Windows/MainWindow.xaml+++ b/.Source/GTweak/Windows/MainWindow.xaml@@ -29,7 +29,7 @@<DockPanel Grid.Column="0" VerticalAlignment="Center" LastChildFill="False" Height="48"><Image Width="20" Height="20" Source="/GTweak.ico" Stretch="Uniform" DockPanel.Dock="Left" VerticalAlignment="Center" Margin="15,0,0,0" />- <TextBlock x:Name="TitleName" Text="GTweak" FontSize="17" FontFamily="{StaticResource Jura}" Foreground="{StaticResource Brush_Accent}" VerticalAlignment="Center" Margin="10,0,20,0" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" KeyboardNavigation.IsTabStop="False" Width="61">+ <TextBlock x:Name="TitleName" Text="GTweak" FontSize="17" FontFamily="{StaticResource Jura}" Foreground="{StaticResource Brush_Accent}" VerticalAlignment="Center" Margin="10,0,20,0" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" KeyboardNavigation.IsTabStop="False" Width="65"><TextBlock.CacheMode><BitmapCache RenderAtScale="2" EnableClearType="True"/></TextBlock.CacheMode>diff --git a/.Source/GTweak/Windows/MainWindow.xaml.cs b/.Source/GTweak/Windows/MainWindow.xaml.csindex 25049675..8add4b2d 100644--- a/.Source/GTweak/Windows/MainWindow.xaml.cs+++ b/.Source/GTweak/Windows/MainWindow.xaml.cs@@ -31,6 +31,25 @@ namespace GTweak.WindowsInitializeComponent();App.TweaksImported += delegate { BtnUtils.IsChecked = true; };}+ protected override void OnSourceInitialized(EventArgs e)+ {+ base.OnSourceInitialized(e);++ Rect area = SystemParameters.WorkArea;++ double rawWidth = area.Width * (area.Width <= 1600 ? 0.82 : 0.62);+ Width = Math.Max(1150, Math.Min(rawWidth, 1500));++ if (Width > area.Width)+ {+ Width = area.Width * 0.96;+ }++ Height = Math.Min(Width / 1.8, area.Height * 0.90);++ Left = area.Left + (area.Width - Width) / 2;+ Top = area.Top + (area.Height - Height) / 2;+ }private void AnimateSettings(){@@ -162,14 +181,6 @@ namespace GTweak.Windowsprivate async void Window_Loaded(object sender, RoutedEventArgs e){- (double screenWidth, double screenHeight) = (SystemParameters.PrimaryScreenWidth, SystemParameters.PrimaryScreenHeight);-- Width = screenWidth * 0.61;- Height = screenHeight * 0.60;-- Left = (screenWidth - Width) / 2;- Top = (screenHeight - Height) / 2;-TypewriterAnimation.Create(TitleName.Text, TitleName, TimeSpan.FromSeconds(0.4));if (SystemDataCollector.IsNeedUpdate && SettingsEngine.IsUpdateCheckRequired)@@ -177,8 +188,13 @@ namespace GTweak.Windowsawait Task.Delay(500);UpdateBanner.Visibility = Visibility.Visible;+UpdateBanner.BeginAnimation(OpacityProperty, FactoryAnimation.CreateIn(0, 1, 0.3));- (UpdateBanner.RenderTransform as TranslateTransform).BeginAnimation(TranslateTransform.YProperty, FactoryAnimation.CreateIn(-20, 0, 0.3, useCubicEase: true));++ if (UpdateBanner.RenderTransform is TranslateTransform transform)+ {+ transform.BeginAnimation(TranslateTransform.YProperty, FactoryAnimation.CreateIn(-20, 0, 0.3, useCubicEase: true));+ }}}}diff --git a/.Source/GTweak/app.manifest b/.Source/GTweak/app.manifestindex 52f9dd96..d4a4fce1 100644--- a/.Source/GTweak/app.manifest+++ b/.Source/GTweak/app.manifest@@ -2,22 +2,16 @@<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"><assemblyIdentity version="1.0.0.0" name="MyApplication.app"/><trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">-<security><requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">-<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-</requestedPrivileges></security>-</trustInfo>-- <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">- <application>- <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>- <longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>- </application>- </compatibility>-+ <application xmlns="urn:schemas-microsoft-com:asm.v3">+ <windowsSettings>+ <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>+ <longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings"> rue</longPathAware>+ </windowsSettings>+ </application></assembly>