Skip to content

Portable Tool for an Ideal Windows Setup

-fixed blick for btn hidden ip & changed events

Greedeksa2fc7be1883e
diff --git a/.Source/GTweak/Assets/UserControl/Card.xaml b/.Source/GTweak/Assets/UserControl/Card.xaml
index 7211fa7f..e75babdc 100644
--- a/.Source/GTweak/Assets/UserControl/Card.xaml
+++ b/.Source/GTweak/Assets/UserControl/Card.xaml
@@ -14,7 +14,7 @@
</Grid>
<TextBlock x:Name="CardTitle" Style="{StaticResource Text}" Margin="0,5,0,0" FontSize="11pt" Width="Auto" Height="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Text="Title"/>
<TextBlock x:Name="CardText" Style="{StaticResource Text}" Foreground="{StaticResource Color_TetBlock_Inactivity}" Margin="0,10,0,0" FontSize="11pt" Width="218" Height="70" HorizontalAlignment="Center" TextAlignment="Center" Text="Text"/>
- <Button x:Name="CardButton" Content="Content" Style="{StaticResource BtnDefault}" Width="150" Height="30" Margin="0,10,0,0" Cursor="Hand" PreviewMouseDown="CardButton_PreviewMouseDown"/>
+ <Button x:Name="CardButton" Content="Content" Style="{StaticResource BtnDefault}" Width="150" Height="30" Margin="0,10,0,0" Cursor="Hand" PreviewMouseLeftButtonUp="CardButton_PreviewMouseLeftButtonUp"/>
</StackPanel>
</Border>
</Grid>
diff --git a/.Source/GTweak/Assets/UserControl/Card.xaml.cs b/.Source/GTweak/Assets/UserControl/Card.xaml.cs
index c779525f..507e5c61 100644
--- a/.Source/GTweak/Assets/UserControl/Card.xaml.cs
+++ b/.Source/GTweak/Assets/UserControl/Card.xaml.cs
@@ -29,12 +29,6 @@ namespace GTweak.Assets.UserControl
InitializeComponent();
}
- private void CardButton_PreviewMouseDown(object sender, MouseButtonEventArgs e)
- {
- if (e.LeftButton == MouseButtonState.Pressed && ClickButton != null)
- {
- ClickButton(this, EventArgs.Empty);
- }
- }
+ private void CardButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) => ClickButton?.Invoke(this, EventArgs.Empty);
}
}
diff --git a/.Source/GTweak/Assets/UserControl/ToggleButton.xaml b/.Source/GTweak/Assets/UserControl/ToggleButton.xaml
index df24c3c8..0a305b54 100644
--- a/.Source/GTweak/Assets/UserControl/ToggleButton.xaml
+++ b/.Source/GTweak/Assets/UserControl/ToggleButton.xaml
@@ -8,7 +8,7 @@
d:Height="auto" d:Width="auto" SnapsToDevicePixels="True" UseLayoutRounding="True">
<Grid Width="Auto">
<StackPanel Orientation="Horizontal">
- <Viewbox Margin="0" KeyboardNavigation.IsTabStop="False" MouseLeftButtonDown="Toggle_MouseLeftButtonDown">
+ <Viewbox Margin="0" KeyboardNavigation.IsTabStop="False" MouseLeftButtonUp="Toggle_MouseLeftButtonUp">
<Grid Height="60" VerticalAlignment="Center" Width="Auto" Cursor="Hand">
<Rectangle x:Name="Back" Cursor="Hand" HorizontalAlignment="Left" Height="56.5" VerticalAlignment="Top" Width="96.5" Margin="2,2,0,0" RadiusY="29" RadiusX="29" KeyboardNavigation.IsTabStop="False" >
<Rectangle.Fill>
diff --git a/.Source/GTweak/Assets/UserControl/ToggleButton.xaml.cs b/.Source/GTweak/Assets/UserControl/ToggleButton.xaml.cs
index b7d661f3..1e906209 100644
--- a/.Source/GTweak/Assets/UserControl/ToggleButton.xaml.cs
+++ b/.Source/GTweak/Assets/UserControl/ToggleButton.xaml.cs
@@ -57,7 +57,7 @@ namespace GTweak.Assets.UserControl
AnimationToggle(_state, true);
}
- private void Toggle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ private void Toggle_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
if (sender.GetType().Name != "TextBlock")
{
diff --git a/.Source/GTweak/Utilities/Tweaks/SystemData.cs b/.Source/GTweak/Utilities/Tweaks/SystemData.cs
index 19991660..d015d6e3 100644
--- a/.Source/GTweak/Utilities/Tweaks/SystemData.cs
+++ b/.Source/GTweak/Utilities/Tweaks/SystemData.cs
@@ -130,7 +130,7 @@ namespace GTweak.Utilities.Tweaks
/// Conection block - [2];
/// Connection limited - [3].
/// </summary>
- internal static byte ConnectionStatus = 0;
+ internal static byte ConnectionStatus = 1;
private static string _type = string.Empty;
@@ -285,14 +285,6 @@ namespace GTweak.Utilities.Tweaks
}
finally
{
- switch (ConnectionStatus)
- {
- case 2:
- case 3:
- ConnectionStatus = 0;
- break;
- }
-
if (IPAddress.TryParse(clientInternetProtocol.Ip, out _) && !string.IsNullOrEmpty(clientInternetProtocol.Ip) && !string.IsNullOrEmpty(clientInternetProtocol.Country))
{
ConnectionStatus = 0;
diff --git a/.Source/GTweak/View/InformationSystemView.xaml b/.Source/GTweak/View/InformationSystemView.xaml
index 4f00f3fb..3f30af52 100644
--- a/.Source/GTweak/View/InformationSystemView.xaml
+++ b/.Source/GTweak/View/InformationSystemView.xaml
@@ -187,7 +187,7 @@
<BlurEffect Radius="{Binding SetBlurValue}"/>
</TextBlock.Effect>
</TextBlock>
- <ToggleButton x:Name="BtnHiddenIP" Width="20" Height="20" Margin="10,0,0,0" Style="{StaticResource TglButtonIP}" IsChecked="{Binding StateButton}" Visibility="{Binding SetVisibility}" PreviewMouseDown="BtnHiddenIP_PreviewMouseDown"/>
+ <ToggleButton x:Name="BtnHiddenIP" Width="20" Height="20" Margin="10,0,0,0" Style="{StaticResource TglButtonIP}" IsChecked="{Binding StateButton}" Visibility="{Binding SetVisibility}" PreviewMouseLeftButtonDown="BtnHiddenIP_PreviewMouseLeftButtonDown"/>
</StackPanel>
</StackPanel>
</Grid>
diff --git a/.Source/GTweak/View/InformationSystemView.xaml.cs b/.Source/GTweak/View/InformationSystemView.xaml.cs
index 7afe5075..078e8456 100644
--- a/.Source/GTweak/View/InformationSystemView.xaml.cs
+++ b/.Source/GTweak/View/InformationSystemView.xaml.cs
@@ -110,22 +110,19 @@ namespace GTweak.View
PopupCopy.BeginAnimation(Popup.VerticalOffsetProperty, doubleAnim);
}
- private void BtnHiddenIP_PreviewMouseDown(object sender, MouseButtonEventArgs e)
+ private void BtnHiddenIP_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
- if (e.LeftButton == MouseButtonState.Pressed)
- {
- Parallel.Invoke(() => { Settings.ChangingParameters(!BtnHiddenIP.IsChecked.Value, "HiddenIP"); });
+ Parallel.Invoke(() => { Settings.ChangingParameters(!BtnHiddenIP.IsChecked.Value, "HiddenIP"); });
- DoubleAnimation doubleAnim = new DoubleAnimation()
- {
- From = BtnHiddenIP.IsChecked.Value ? 20 : 0,
- To = BtnHiddenIP.IsChecked.Value ? 0 : 20,
- EasingFunction = new QuadraticEase(),
- Duration = TimeSpan.FromSeconds(0.2)
- };
- Timeline.SetDesiredFrameRate(doubleAnim, 400);
- IpAddress.Effect.BeginAnimation(BlurEffect.RadiusProperty, doubleAnim);
- }
+ DoubleAnimation doubleAnim = new DoubleAnimation()
+ {
+ From = BtnHiddenIP.IsChecked.Value ? 20 : 0,
+ To = BtnHiddenIP.IsChecked.Value ? 0 : 20,
+ EasingFunction = new QuadraticEase(),
+ Duration = TimeSpan.FromSeconds(0.2)
+ };
+ Timeline.SetDesiredFrameRate(doubleAnim, 400);
+ IpAddress.Effect.BeginAnimation(BlurEffect.RadiusProperty, doubleAnim);
}
private void TextComputerData_PreviewMouseDown(object sender, MouseButtonEventArgs e)
diff --git a/.Source/GTweak/Windows/MainWindow.xaml b/.Source/GTweak/Windows/MainWindow.xaml
index b23f2d72..7c6f141a 100644
--- a/.Source/GTweak/Windows/MainWindow.xaml
+++ b/.Source/GTweak/Windows/MainWindow.xaml
@@ -73,7 +73,7 @@
<StackPanel Orientation="Horizontal" Width="Auto" VerticalAlignment="Center" HorizontalAlignment="Right">
- <Button x:Name="ButtonSettings" Style="{StaticResource TitleButtons}" VerticalAlignment="Center" HorizontalAlignment="Right" Width="25" Height="30" Margin="0,0,10,0" PreviewMouseDown="ButtonSettings_PreviewMouseDown">
+ <Button x:Name="ButtonSettings" Style="{StaticResource TitleButtons}" VerticalAlignment="Center" HorizontalAlignment="Right" Width="25" Height="30" Margin="0,0,10,0" PreviewMouseLeftButtonUp="ButtonSettings_PreviewMouseLeftButtonUp">
<Image x:Name="ImageSettings" Width="18" Height="18" RenderTransformOrigin="0.5, 0.5">
<Image.RenderTransform>
<RotateTransform x:Name="noFreeze" Angle="0"/>
@@ -91,7 +91,7 @@
</Image>
</Button>
- <Button x:Name="ButtonMinimized" VerticalAlignment="Center" HorizontalAlignment="Right" Width="25" Height="30" Margin="0,0,5,0" PreviewMouseDown="ButtonMinimized_PreviewMouseDown">
+ <Button x:Name="ButtonMinimized" VerticalAlignment="Center" HorizontalAlignment="Right" Width="25" Height="30" Margin="0,0,5,0" PreviewMouseLeftButtonUp="ButtonMinimized_PreviewMouseLeftButtonUp">
<Image Height="2" Width="3" Grid.Column="3" Margin="-12,3,0,0" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image.RenderTransform>
<TransformGroup>
@@ -138,7 +138,7 @@
</Button.Style>
</Button>
- <Button x:Name="ButtonExit" Style="{StaticResource TitleButtons}" VerticalAlignment="Center" HorizontalAlignment="Right" Width="25" Height="30" Margin="0,0,10,0" PreviewMouseDown="ButtonExit_PreviewMouseDown">
+ <Button x:Name="ButtonExit" Style="{StaticResource TitleButtons}" VerticalAlignment="Center" HorizontalAlignment="Right" Width="25" Height="30" Margin="0,0,10,0" PreviewMouseLeftButtonUp="ButtonExit_PreviewMouseLeftButtonUp">
<Image Width="12">
<Image.Style>
<Style TargetType="{x:Type Image}">
@@ -198,7 +198,7 @@
<StackPanel Orientation="Horizontal" Height="45" VerticalAlignment="Top" Margin="40,10,0,0">
<TextBlock Style="{StaticResource Text_In}" Foreground="{StaticResource Color_Highlighted}" Margin="0,4,0,0" Text="{DynamicResource slider_volume_main}"/>
- <ToggleButton x:Name="BtnSoundNtn" Width="20" Height="20" Margin="10,1,0,0" Style="{StaticResource TglButtonSound}" PreviewMouseDown="BtnSoundNtn_PreviewMouseDown"/>
+ <ToggleButton x:Name="BtnSoundNtn" Width="20" Height="20" Margin="10,1,0,0" Style="{StaticResource TglButtonSound}" PreviewMouseLeftButtonUp="BtnSoundNtn_PreviewMouseLeftButtonUp"/>
<Slider x:Name="SliderVolume" Style="{StaticResource HorizontalText_Slider}" IsSnapToTickEnabled="True" Minimum="0" Maximum="100" Margin="10,4,0,0" Width="187" ValueChanged="SliderVolume_ValueChanged" Height="10"/>
</StackPanel>
@@ -223,7 +223,7 @@
<StackPanel Orientation="Horizontal" Margin="40,15,0,0">
<TextBlock Style="{StaticResource Text_In}" Foreground="{StaticResource Color_Highlighted}" Margin="0,4,0,0" Text="{DynamicResource text_saveconfig}"/>
- <Button x:Name="BtnExport" Style="{StaticResource BtnDefault}" Width="106" Height="26" Margin="10,0,0,0" Cursor="Hand" PreviewMouseDown="BtnExport_PreviewMouseDown">
+ <Button x:Name="BtnExport" Style="{StaticResource BtnDefault}" Width="106" Height="26" Margin="10,0,0,0" Cursor="Hand" PreviewMouseLeftButtonUp="BtnExport_PreviewMouseLeftButtonUp">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{DynamicResource btn_export}" Margin="0,2,0,0"/>
<Image Margin="5,0,0,0" Width="20" Height="20">
@@ -235,7 +235,7 @@
</Image>
</StackPanel>
</Button>
- <Button x:Name="BtnImport" Style="{StaticResource BtnDefaultM}" Width="106" Height="26" Margin="10,0,0,0" Cursor="Hand" PreviewMouseDown="BtnImport_PreviewMouseDown">
+ <Button x:Name="BtnImport" Style="{StaticResource BtnDefaultM}" Width="106" Height="26" Margin="10,0,0,0" Cursor="Hand" PreviewMouseLeftButtonUp="BtnImport_PreviewMouseLeftButtonUp">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{DynamicResource btn_import}" Margin="0,2,0,0"/>
<Image Margin="5,0,0,0" Width="20" Height="20">
@@ -251,7 +251,7 @@
<StackPanel Orientation="Horizontal" Margin="40,20,0,0">
<TextBlock Style="{StaticResource Text_In}" Foreground="{StaticResource Color_Highlighted}" Margin="0,4,0,0" Text="{DynamicResource text_selfremove}"/>
- <Button x:Name="BtnDelete" Content="{DynamicResource btn_selfremove}" Style="{StaticResource BtnDefault}" Width="107" Height="26" Margin="10,0,0,0" Cursor="Hand" PreviewMouseDown="BtnDelete_PreviewMouseDown"/>
+ <Button x:Name="BtnDelete" Content="{DynamicResource btn_selfremove}" Style="{StaticResource BtnDefault}" Width="107" Height="26" Margin="10,0,0,0" Cursor="Hand" PreviewMouseLeftButtonUp="BtnDelete_PreviewMouseLeftButtonUp"/>
</StackPanel>
</StackPanel>
</Grid>
@@ -264,21 +264,21 @@
<Grid Grid.Column="0">
<StackPanel Orientation="Horizontal" Margin="20,0,0,0">
- <Image x:Uid="git" Width="31" Height="auto" PreviewMouseDown="BtnContats_PreviewMouseDown" Cursor="Hand">
+ <Image x:Uid="git" Width="31" Height="auto" PreviewMouseLeftButtonUp="BtnContats_PreviewMouseLeftButtonUp" Cursor="Hand">
<Image.Style>
<Style TargetType="{x:Type Image}" BasedOn="{StaticResource Apps}">
<Setter Property="Source" Value="{StaticResource DI_Git}"/>
</Style>
</Image.Style>
</Image>
- <Image x:Uid="tg" Width="31" Height="auto" PreviewMouseDown="BtnContats_PreviewMouseDown" Cursor="Hand">
+ <Image x:Uid="tg" Width="31" Height="auto" PreviewMouseLeftButtonUp="BtnContats_PreviewMouseLeftButtonUp" Cursor="Hand">
<Image.Style>
<Style TargetType="{x:Type Image}" BasedOn="{StaticResource Apps}">
<Setter Property="Source" Value="{StaticResource DI_Telegram}"/>
</Style>
</Image.Style>
</Image>
- <Image x:Uid="steam" Width="31" Height="auto" PreviewMouseDown="BtnContats_PreviewMouseDown" Cursor="Hand">
+ <Image x:Uid="steam" Width="31" Height="auto" PreviewMouseLeftButtonUp="BtnContats_PreviewMouseLeftButtonUp" Cursor="Hand">
<Image.Style>
<Style TargetType="{x:Type Image}" BasedOn="{StaticResource Apps}">
<Setter Property="Source" Value="{StaticResource DI_Steam}"/>
diff --git a/.Source/GTweak/Windows/MainWindow.xaml.cs b/.Source/GTweak/Windows/MainWindow.xaml.cs
index f3871bf9..45765be0 100644
--- a/.Source/GTweak/Windows/MainWindow.xaml.cs
+++ b/.Source/GTweak/Windows/MainWindow.xaml.cs
@@ -68,22 +68,22 @@ namespace GTweak
});
}
- private void ButtonSettings_PreviewMouseDown(object sender, MouseButtonEventArgs e)
+ private void SettingsMenu_QueryCursor(object sender, QueryCursorEventArgs e)
{
- if (e.LeftButton == MouseButtonState.Pressed && (SettingsMenu.Width == 0 || SettingsMenu.Width == 400))
+ if (SettingsMenu.Width == 400)
SettingsMenuAnimation();
}
- private void SettingsMenu_QueryCursor(object sender, QueryCursorEventArgs e)
+ private void ButtonSettings_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
- if (SettingsMenu.Width == 400)
+ if (SettingsMenu.Width == 0 || SettingsMenu.Width == 400)
SettingsMenuAnimation();
}
- private void ButtonExit_PreviewMouseDown(object sender, MouseButtonEventArgs e)
- {
- if (e.LeftButton != MouseButtonState.Pressed) return;
+ private void ButtonMinimized_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) => this.WindowState = WindowState.Minimized;
+ private void ButtonExit_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+ {
switch (SystemTweaks.isTweakWorkingAntivirus)
{
case false:
@@ -95,12 +95,6 @@ namespace GTweak
}
}
- private void ButtonMinimized_PreviewMouseDown(object sender, MouseButtonEventArgs e)
- {
- if (e.LeftButton == MouseButtonState.Pressed)
- this.WindowState = WindowState.Minimized;
- }
-
private void TitleBar_MouseDown(object sender, MouseButtonEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
@@ -160,10 +154,9 @@ namespace GTweak
Parallel.Invoke(() => { Settings.ChangingParameters(SliderVolume.Value, "Volume"); });
}
- private void BtnSoundNtn_PreviewMouseDown(object sender, MouseButtonEventArgs e)
+ private void BtnSoundNtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
- if (e.LeftButton == MouseButtonState.Pressed)
- Parallel.Invoke(() => { Settings.ChangingParameters(!BtnSoundNtn.IsChecked, "Sound"); });
+ Parallel.Invoke(() => { Settings.ChangingParameters(!BtnSoundNtn.IsChecked, "Sound"); });
}
private void LanguageSelectionMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -200,43 +193,27 @@ namespace GTweak
}
}
- private void BtnExport_PreviewMouseDown(object sender, MouseButtonEventArgs e)
- {
- if (e.LeftButton == MouseButtonState.Pressed)
- Parallel.Invoke(Settings.SaveFileConfig);
- }
+ private void BtnExport_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) => Parallel.Invoke(Settings.SaveFileConfig);
- private void BtnImport_PreviewMouseDown(object sender, MouseButtonEventArgs e)
- {
- if (e.LeftButton == MouseButtonState.Pressed)
- Parallel.Invoke(Settings.OpenFileConfig);
- }
+ private void BtnImport_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) => Parallel.Invoke(Settings.OpenFileConfig);
- private void BtnDelete_PreviewMouseDown(object sender, MouseButtonEventArgs e)
- {
- if (e.LeftButton == MouseButtonState.Pressed)
- Settings.SelfRemoval();
- }
+ private void BtnDelete_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) => Settings.SelfRemoval();
- private void BtnContats_PreviewMouseDown(object sender, MouseButtonEventArgs e)
+ private void BtnContats_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
- if (e.LeftButton == MouseButtonState.Pressed)
+ Image btnConcat = (Image)sender;
+ switch (btnConcat.Uid)
{
- Image btnConcat = (Image)sender;
- switch (btnConcat.Uid)
- {
- case "git":
- Process.Start("https://github.com/Greedeks");
- break;
- case "tg":
- Process.Start("https://t.me/Greedeks");
- break;
- case "steam":
- Process.Start("https://steamcommunity.com/id/greedeks/");
- break;
- }
+ case "git":
+ Process.Start("https://github.com/Greedeks");
+ break;
+ case "tg":
+ Process.Start("https://t.me/Greedeks");
+ break;
+ case "steam":
+ Process.Start("https://steamcommunity.com/id/greedeks/");
+ break;
}
-
}
#endregion
}