Portable Tool for an Ideal Windows Setup
C# activatorbloatware-removalcsharpdebloatdebloaterdisable-servicesmonitoring-systemportableprivacy-toolsregistry-tweakssystem-tuningsystem-utilitytelemetrytweakerwindows-10windows-11windows-debloatwindows-defenderwindows-optimizationwindows-tweaks
fix resolve visual state inconsistency for some tgl-btns under specific conditions
Greedeksb88fad1a370d
diff --git a/.Source/GTweak/Core/ViewModel/MainWinViewModel.cs b/.Source/GTweak/Core/ViewModel/MainWinViewModel.csindex 061f4d95..2eaad85c 100644--- a/.Source/GTweak/Core/ViewModel/MainWinViewModel.cs+++ b/.Source/GTweak/Core/ViewModel/MainWinViewModel.cs@@ -38,8 +38,7 @@ namespace GTweak.Core.ViewModelget => !string.Equals(SettingsEngine.Theme, SettingsEngine.AvailableThemes.First(), StringComparison.OrdinalIgnoreCase);set{- SettingsEngine.Theme = value == false ? SettingsEngine.AvailableThemes.First() : SettingsEngine.AvailableThemes.Last();- App.Theme = SettingsEngine.Theme;+ App.Theme = SettingsEngine.Theme = value == false ? SettingsEngine.AvailableThemes.First() : SettingsEngine.AvailableThemes.Last();OnPropertyChanged();}}diff --git a/.Source/GTweak/Styles/Buttons/ToggleButtons.xaml b/.Source/GTweak/Styles/Buttons/ToggleButtons.xamlindex a54c2d7c..991df583 100644--- a/.Source/GTweak/Styles/Buttons/ToggleButtons.xaml+++ b/.Source/GTweak/Styles/Buttons/ToggleButtons.xaml@@ -1,4 +1,4 @@-<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"><Style x:Key="TglThemeSwitch" TargetType="{x:Type ToggleButton}">@@ -18,7 +18,7 @@<Grid><Border x:Name="BackgroundBorder" Background="Transparent" CornerRadius="4"/><Grid x:Name="IconContainer" SnapsToDevicePixels="True">- <Border x:Name="Icon" Width="18" Height="18"/>+ <Border x:Name="Icon" Width="18" Height="18" Margin="0,2,0,0"/></Grid></Grid><ControlTemplate.Triggers>diff --git a/.Source/GTweak/Utilities/Configuration/DiskTypeIdentifier.cs b/.Source/GTweak/Utilities/Configuration/DiskTypeIdentifier.csindex 2b09501c..102996ea 100644--- a/.Source/GTweak/Utilities/Configuration/DiskTypeIdentifier.cs+++ b/.Source/GTweak/Utilities/Configuration/DiskTypeIdentifier.cs@@ -4,7 +4,7 @@ using Microsoft.Win32.SafeHandles;namespace GTweak.Utilities.Configuration{- internal static class DiskTypeIdentifier+ internal static class DiskTypeIdentifier{private const uint IOCTL_STORAGE_QUERY_PROPERTY = 0x2D1400;private const uint FILE_SHARE_READ = 1;diff --git a/.Source/GTweak/View/DataSystemView.xaml b/.Source/GTweak/View/DataSystemView.xamlindex 0dfec420..492bd52a 100644--- a/.Source/GTweak/View/DataSystemView.xaml+++ b/.Source/GTweak/View/DataSystemView.xaml@@ -1,4 +1,4 @@-<UserControl x:Class="GTweak.View.DataSystemView"+<UserControl x:Class="GTweak.View.DataSystemView"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"@@ -305,7 +305,7 @@<BlurEffect Radius="{Binding SetBlurValue}"/></TextBlock.Effect></TextBlock>- <ToggleButton x:Name="BtnVision" Margin="10,0,0,0" Width="24" Height="24" Visibility="{Binding SetVisibility}" VerticalAlignment="Center" Style="{StaticResource TglVision}" IsChecked="{Binding StateButtonVision}" PreviewMouseLeftButtonUp="BtnVision_PreviewMouseLeftButtonUp"/>+ <ToggleButton x:Name="BtnVision" Margin="10,0,0,0" Width="24" Height="24" Visibility="{Binding SetVisibility}" VerticalAlignment="Center" Style="{StaticResource TglVision}" IsChecked="{Binding StateButtonVision}" Click="BtnVision_Click"/></StackPanel></StackPanel>diff --git a/.Source/GTweak/View/DataSystemView.xaml.cs b/.Source/GTweak/View/DataSystemView.xaml.csindex 64f4d974..b60ac328 100644--- a/.Source/GTweak/View/DataSystemView.xaml.cs+++ b/.Source/GTweak/View/DataSystemView.xaml.cs@@ -102,7 +102,7 @@ namespace GTweak.ViewPopupCopy.BeginAnimation(Popup.VerticalOffsetProperty, FactoryAnimation.CreateIn(-20, -50, 0.35, null, false, true));}- private void BtnVision_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)+ private void BtnVision_Click(object sender, RoutedEventArgs e){SettingsEngine.IsHiddenIpAddress = !BtnVision.IsChecked.Value;IpAddress.Effect.BeginAnimation(BlurEffect.RadiusProperty, BtnVision.IsChecked.Value ? FactoryAnimation.CreateTo(0.2) : FactoryAnimation.CreateIn(0, 20, 0.2));diff --git a/.Source/GTweak/Windows/MainWindow.xaml b/.Source/GTweak/Windows/MainWindow.xamlindex 2eeeb7bc..054453a1 100644--- a/.Source/GTweak/Windows/MainWindow.xaml+++ b/.Source/GTweak/Windows/MainWindow.xaml@@ -1,4 +1,4 @@-<ui:FluentWindow x:Class="GTweak.Windows.MainWindow"+<ui:FluentWindow x:Class="GTweak.Windows.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"@@ -23,15 +23,15 @@<Grid x:Name="TitleBar" Grid.Row="0" MouseDown="TitleBar_MouseDown" Background="Transparent" PreviewMouseDown="TitleBar_PreviewMouseDown"><StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right">- <ToggleButton x:Name="ButtonTheme" IsChecked="{Binding StateButtonTheme}" Style="{StaticResource TglThemeSwitch}" PreviewMouseLeftButtonUp="TitleButton_PreviewMouseLeftButtonUp"/>+ <ToggleButton x:Name="ButtonTheme" IsChecked="{Binding StateButtonTheme}" Style="{StaticResource TglThemeSwitch}" Margin="0,0,0,2" HorizontalAlignment="Right" VerticalAlignment="Center" Click="TitleButton_Click"/>- <Button x:Name="ButtonSettings" Style="{StaticResource TitleButtonSettings}" Margin="0,0,10,2" HorizontalAlignment="Right" VerticalAlignment="Center" PreviewMouseLeftButtonUp="TitleButton_PreviewMouseLeftButtonUp"/>+ <Button x:Name="ButtonSettings" Style="{StaticResource TitleButtonSettings}" Margin="0,0,10,2" HorizontalAlignment="Right" VerticalAlignment="Center" Click="TitleButton_Click"/>- <Button x:Name="ButtonMinimize" Style="{StaticResource TitleButtonMinimize}" Margin="0,0,0,2" HorizontalAlignment="Right" VerticalAlignment="Center" PreviewMouseLeftButtonUp="TitleButton_PreviewMouseLeftButtonUp"/>+ <Button x:Name="ButtonMinimize" Style="{StaticResource TitleButtonMinimize}" Margin="0,0,0,2" HorizontalAlignment="Right" VerticalAlignment="Center" Click="TitleButton_Click"/>- <Button x:Name="ButtonMaximize" Style="{StaticResource TitleButtonMaximize}" Margin="0,0,0,2" HorizontalAlignment="Right" VerticalAlignment="Center" PreviewMouseLeftButtonUp="TitleButton_PreviewMouseLeftButtonUp"/>+ <Button x:Name="ButtonMaximize" Style="{StaticResource TitleButtonMaximize}" Margin="0,0,0,2" HorizontalAlignment="Right" VerticalAlignment="Center" Click="TitleButton_Click"/>- <Button x:Name="ButtonClose" Style="{StaticResource TitleButtonClose}" Margin="0,0,5,2" HorizontalAlignment="Right" VerticalAlignment="Center" PreviewMouseLeftButtonUp="TitleButton_PreviewMouseLeftButtonUp"/>+ <Button x:Name="ButtonClose" Style="{StaticResource TitleButtonClose}" Margin="0,0,5,2" HorizontalAlignment="Right" VerticalAlignment="Center" Click="TitleButton_Click"/></StackPanel>@@ -123,7 +123,7 @@<Viewbox HorizontalAlignment="Left" Stretch="Uniform" StretchDirection="DownOnly" Height="45" Margin="40,10,10,0"><StackPanel Orientation="Horizontal" VerticalAlignment="Top"><TextBlock Style="{StaticResource TextDefault}" Text="{DynamicResource slider_volume_main}"/>- <ToggleButton x:Name="BtnVolume" IsChecked="{Binding IsPlayingSound, Mode=OneWay}" Width="20" Height="20" Margin="10,4,0,0" Style="{StaticResource TglVolume}" PreviewMouseLeftButtonUp="BtnVolume_PreviewMouseLeftButtonUp"/>+ <ToggleButton x:Name="BtnVolume" IsChecked="{Binding IsPlayingSound, Mode=OneWay}" Width="20" Height="20" Margin="10,4,0,0" Style="{StaticResource TglVolume}" Click="BtnVolume_Click"/><Slider x:Name="SliderVolume" Style="{StaticResource Percent_Slider}" Value="{Binding CurrentVolume, Mode=OneWay}" IsSnapToTickEnabled="True" Minimum="0" Maximum="100" Margin="10,5,0,0" Width="187" Height="12" ValueChanged="SliderVolume_ValueChanged"/></StackPanel></Viewbox>diff --git a/.Source/GTweak/Windows/MainWindow.xaml.cs b/.Source/GTweak/Windows/MainWindow.xaml.csindex c4c84f81..1b0f4aa4 100644--- a/.Source/GTweak/Windows/MainWindow.xaml.cs+++ b/.Source/GTweak/Windows/MainWindow.xaml.cs@@ -62,7 +62,8 @@ namespace GTweak.Windows}}- private void TitleButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)++ private void TitleButton_Click(object sender, RoutedEventArgs e){switch ((sender as FrameworkElement)?.Name){@@ -93,7 +94,7 @@ namespace GTweak.Windowsprivate void BtnTopMost_ChangedState(object sender, RoutedEventArgs e) => SettingsEngine.IsTopMost = Topmost = !BtnTopMost.State;- private void BtnVolume_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) => SettingsEngine.IsPlayingSound = (bool)!BtnVolume.IsChecked;+ private void BtnVolume_Click(object sender, RoutedEventArgs e) => SettingsEngine.IsPlayingSound = (bool)!BtnVolume.IsChecked;private void SliderVolume_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e){