Skip to content

Portable Tool for an Ideal Windows Setup

upd. network connectivity & IP detection logic ref & upd. styles

Greedeks37e18922b0d9
diff --git a/.Source/GTweak/Assets/UserControls/Card.xaml b/.Source/GTweak/Assets/UserControls/Card.xaml
index 2e0e4da7..412b82f5 100644
--- a/.Source/GTweak/Assets/UserControls/Card.xaml
+++ b/.Source/GTweak/Assets/UserControls/Card.xaml
@@ -9,7 +9,7 @@
SnapsToDevicePixels="True" UseLayoutRounding="True">
<Viewbox Stretch="Uniform" VerticalAlignment="Center" HorizontalAlignment="Left">
<Grid HorizontalAlignment="Center">
- <Border CornerRadius="8" Opacity="0.5" Background="#33000000" IsHitTestVisible="False" HorizontalAlignment="Center" VerticalAlignment="Top" Width="{Binding ActualWidth, ElementName=CardBody}" Height="{Binding ActualHeight, ElementName=CardBody}">
+ <Border CornerRadius="8" Opacity="0.5" Background="{StaticResource Brush_ShadowOverlay}" IsHitTestVisible="False" HorizontalAlignment="Center" VerticalAlignment="Top" Width="{Binding ActualWidth, ElementName=CardBody}" Height="{Binding ActualHeight, ElementName=CardBody}">
<Border.RenderTransform>
<TranslateTransform X="3" Y="6" />
</Border.RenderTransform>
diff --git a/.Source/GTweak/Assets/UserControls/ColorPicker.xaml b/.Source/GTweak/Assets/UserControls/ColorPicker.xaml
index 91d9737a..0818eac6 100644
--- a/.Source/GTweak/Assets/UserControls/ColorPicker.xaml
+++ b/.Source/GTweak/Assets/UserControls/ColorPicker.xaml
@@ -16,7 +16,7 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
- <Ellipse Grid.Column="0" Fill="#33000000" Width="20" Height="20" Margin="0,0,8,0" Opacity="0.7">
+ <Ellipse Grid.Column="0" Fill="{StaticResource Brush_ShadowOverlay}" Width="20" Height="20" Margin="0,0,8,0" Opacity="0.7">
<Ellipse.RenderTransform>
<TranslateTransform X="1" Y="1" />
</Ellipse.RenderTransform>
diff --git a/.Source/GTweak/Assets/UserControls/FileCard.xaml b/.Source/GTweak/Assets/UserControls/FileCard.xaml
index fe87629c..0e9953e3 100644
--- a/.Source/GTweak/Assets/UserControls/FileCard.xaml
+++ b/.Source/GTweak/Assets/UserControls/FileCard.xaml
@@ -10,7 +10,7 @@
<Grid Cursor="Hand">
<ProgressBar x:Name="ProgressBar" Height="4" Margin="8,0,8,0" Width="Auto" VerticalAlignment="Top" Visibility="Collapsed" Value="0" Maximum="100" Foreground="{StaticResource Brush_Accent}" />
- <Border CornerRadius="8" Opacity="0.45" Background="#33000000" IsHitTestVisible="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Panel.ZIndex="0">
+ <Border CornerRadius="8" Opacity="0.45" Background="{StaticResource Brush_ShadowOverlay}" IsHitTestVisible="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Panel.ZIndex="0">
<Border.RenderTransform>
<TranslateTransform X="3" Y="6" />
</Border.RenderTransform>
diff --git a/.Source/GTweak/Styles/Buttons/RadioButtons.xaml b/.Source/GTweak/Styles/Buttons/RadioButtons.xaml
index b7267596..0b2bbc28 100644
--- a/.Source/GTweak/Styles/Buttons/RadioButtons.xaml
+++ b/.Source/GTweak/Styles/Buttons/RadioButtons.xaml
@@ -22,14 +22,14 @@
<Grid.CacheMode>
<BitmapCache RenderAtScale="2" EnableClearType="True"/>
</Grid.CacheMode>
- <Border x:Name="ShadowPanel" CornerRadius="12" Opacity="0" Background="#33000000" IsHitTestVisible="False" Width="{Binding ActualWidth, ElementName=InnerPanel}" Height="{Binding ActualHeight, ElementName=InnerPanel}" HorizontalAlignment="Left" VerticalAlignment="Center">
+ <Border x:Name="ShadowPanel" CornerRadius="12" Opacity="0" Background="{StaticResource Brush_ShadowOverlay}" IsHitTestVisible="False" Width="{Binding ActualWidth, ElementName=InnerPanel}" Height="{Binding ActualHeight, ElementName=InnerPanel}" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.RenderTransform>
<TranslateTransform X="3" Y="4" />
</Border.RenderTransform>
</Border>
<Border x:Name="InnerPanel" Height="48" CornerRadius="12" Background="{TemplateBinding Background}" HorizontalAlignment="Left" VerticalAlignment="Center" Padding="0,0,10,0">
<Grid Height="48">
- <Rectangle x:Name="ContentShadowMask" Grid.ColumnSpan="2" Fill="#33000000" Opacity="{StaticResource IconNavigation_Opacity}" IsHitTestVisible="False">
+ <Rectangle x:Name="ContentShadowMask" Grid.ColumnSpan="2" Fill="{StaticResource Brush_ShadowOverlay}" Opacity="{StaticResource IconNavigation_Opacity}" IsHitTestVisible="False">
<Rectangle.RenderTransform>
<TranslateTransform X="3" Y="3" />
</Rectangle.RenderTransform>
diff --git a/.Source/GTweak/Styles/Inputs/Slider.xaml b/.Source/GTweak/Styles/Inputs/Slider.xaml
index fb883d1f..2ef103a8 100644
--- a/.Source/GTweak/Styles/Inputs/Slider.xaml
+++ b/.Source/GTweak/Styles/Inputs/Slider.xaml
@@ -84,7 +84,7 @@
</Setter>
</Style>
- <ControlTemplate x:Key="Slider" TargetType="{x:Type Slider}">
+ <ControlTemplate x:Key="Slider" TargetType="{x:Type Slider}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -102,13 +102,11 @@
<RepeatButton Style="{StaticResource SliderRepeatButton_In}" Command="Slider.IncreaseLarge" />
</Track.IncreaseRepeatButton>
</Track>
- <TextBlock Grid.Row="2" FocusVisualStyle="{x:Null}" Text="{Binding Value, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Slider}}}"
- FontFamily="{StaticResource Play}" FontSize="14px" FontWeight="Medium" Margin="0,-5,0,0" HorizontalAlignment="Center" Typography.NumeralAlignment="Tabular" Typography.NumeralStyle="Lining" Foreground="{DynamicResource Brush_Highlighted}">
- </TextBlock>
+ <TextBlock Grid.Row="2" FocusVisualStyle="{x:Null}" Text="{Binding Value, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Slider}}}" FontFamily="{StaticResource Play}" FontSize="14px" FontWeight="Medium" Margin="0,-5,0,0" HorizontalAlignment="Center" Typography.NumeralAlignment="Tabular" Typography.NumeralStyle="Lining" Foreground="{DynamicResource Brush_Highlighted}"/>
</Grid>
</ControlTemplate>
- <ControlTemplate x:Key="SliderPercent" TargetType="{x:Type Slider}">
+ <ControlTemplate x:Key="SliderPercent" TargetType="{x:Type Slider}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -121,7 +119,7 @@
</Grid.ColumnDefinitions>
<Track Grid.Column="0" Grid.Row="1" x:Name="PART_Track" Cursor="Hand">
<Track.DecreaseRepeatButton>
- <RepeatButton Style="{StaticResource SliderRepeatButton}" Command="Slider.DecreaseLarge" />
+ <RepeatButton Style="{StaticResource SliderRepeatButton}" Command="Slider.DecreaseLarge" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource SliderThumb}" />
@@ -137,24 +135,6 @@
</Grid>
</ControlTemplate>
- <ControlTemplate x:Key="SliderNoText" TargetType="{x:Type Slider}">
- <Grid>
- <Track x:Name="PART_Track" Cursor="Hand">
- <Track.DecreaseRepeatButton>
- <RepeatButton Style="{StaticResource SliderRepeatButton}" Command="Slider.DecreaseLarge"/>
- </Track.DecreaseRepeatButton>
-
- <Track.Thumb>
- <Thumb Style="{StaticResource SliderThumb}"/>
- </Track.Thumb>
-
- <Track.IncreaseRepeatButton>
- <RepeatButton Style="{StaticResource SliderRepeatButton_In}" Command="Slider.IncreaseLarge"/>
- </Track.IncreaseRepeatButton>
- </Track>
- </Grid>
- </ControlTemplate>
-
<Style x:Key="Numeric_Slider" TargetType="{x:Type Slider}">
<Setter Property="Focusable" Value="False"/>
<Setter Property="SnapsToDevicePixels" Value="true" />
@@ -189,14 +169,4 @@
</Style.Triggers>
</Style>
- <Style x:Key="Slider_NoValue" TargetType="{x:Type Slider}">
- <Setter Property="Focusable" Value="False"/>
- <Setter Property="SnapsToDevicePixels" Value="True"/>
- <Setter Property="OverridesDefaultStyle" Value="True"/>
- <Setter Property="IsTabStop" Value="False"/>
- <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
-
- <Setter Property="Template" Value="{StaticResource SliderNoText}"/>
- </Style>
-
</ResourceDictionary>
\ No newline at end of file
diff --git a/.Source/GTweak/Styles/Themes/Dark/Colors.xaml b/.Source/GTweak/Styles/Themes/Dark/Colors.xaml
index 693da321..0ccdc703 100644
--- a/.Source/GTweak/Styles/Themes/Dark/Colors.xaml
+++ b/.Source/GTweak/Styles/Themes/Dark/Colors.xaml
@@ -10,6 +10,7 @@
<SolidColorBrush x:Key="Brush_Inactive" Color="#808080"/>
<SolidColorBrush x:Key="Brush_Highlighted" Color="#FFFFFF"/>
<SolidColorBrush x:Key="Brush_Highlighted_Inverted" Color="#2C2E2D"/>
+ <SolidColorBrush x:Key="Brush_ShadowOverlay" Color="#33000000"/>
<SolidColorBrush x:Key="Brush_TextBlock_Inactivity" Color="#DFDFDF"/>
@@ -58,7 +59,7 @@
<Color x:Key="Color_Background_CheckBox">#40C279</Color>
<sys:Double xmlns:sys="clr-namespace:System;assembly=mscorlib" x:Key="IconAppUnchecked_Opacity">0.1</sys:Double>
- <sys:Double xmlns:sys="clr-namespace:System;assembly=mscorlib" x:Key="RadialProgress_Opacity">0.2</sys:Double>
+ <sys:Double xmlns:sys="clr-namespace:System;assembly=mscorlib" x:Key="DataElement_Opacity">0.2</sys:Double>
<sys:Double xmlns:sys="clr-namespace:System;assembly=mscorlib" x:Key="IconNavigation_Opacity">0.7</sys:Double>
</ResourceDictionary>
\ No newline at end of file
diff --git a/.Source/GTweak/Styles/Themes/Light/Colors.xaml b/.Source/GTweak/Styles/Themes/Light/Colors.xaml
index 84dd348b..60d6d493 100644
--- a/.Source/GTweak/Styles/Themes/Light/Colors.xaml
+++ b/.Source/GTweak/Styles/Themes/Light/Colors.xaml
@@ -10,7 +10,8 @@
<SolidColorBrush x:Key="Brush_Inactive" Color="#6D6D6D"/>
<SolidColorBrush x:Key="Brush_Highlighted" Color="#000000"/>
<SolidColorBrush x:Key="Brush_Highlighted_Inverted" Color="#D8D8D8"/>
-
+ <SolidColorBrush x:Key="Brush_ShadowOverlay" Color="#33000000"/>
+
<SolidColorBrush x:Key="Brush_TextBlock_Inactivity" Color="#404040"/>
<SolidColorBrush x:Key="Brush_CloseBtn_Hover" Color="#C43C2E"/>
@@ -58,6 +59,6 @@
<Color x:Key="Color_Background_CheckBox">#00A15A</Color>
<sys:Double xmlns:sys="clr-namespace:System;assembly=mscorlib" x:Key="IconAppUnchecked_Opacity">0.25</sys:Double>
- <sys:Double xmlns:sys="clr-namespace:System;assembly=mscorlib" x:Key="RadialProgress_Opacity">0.3</sys:Double>
+ <sys:Double xmlns:sys="clr-namespace:System;assembly=mscorlib" x:Key="DataElement_Opacity">0.3</sys:Double>
<sys:Double xmlns:sys="clr-namespace:System;assembly=mscorlib" x:Key="IconNavigation_Opacity">0.3</sys:Double>
</ResourceDictionary>
\ No newline at end of file
diff --git a/.Source/GTweak/Utilities/Configuration/SystemDataCollector.cs b/.Source/GTweak/Utilities/Configuration/SystemDataCollector.cs
index ff246bd5..b56e4f96 100644
--- a/.Source/GTweak/Utilities/Configuration/SystemDataCollector.cs
+++ b/.Source/GTweak/Utilities/Configuration/SystemDataCollector.cs
@@ -53,6 +53,8 @@ namespace GTweak.Utilities.Configuration
}
}
+ private static readonly HttpClient sharedClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
+
internal static bool IsNeedUpdate { get; private set; } = false;
internal static string DownloadVersion { get; private set; } = string.Empty;
@@ -126,7 +128,7 @@ namespace GTweak.Utilities.Configuration
() => GetGraphicsInfo(),
() => GetMemoryInfo(),
() => RefreshDevicesData(),
- () => GetUserIpAddress()
+ () => GetUserIpAddress().GetAwaiter().GetResult()
);
});
}
@@ -610,72 +612,63 @@ namespace GTweak.Utilities.Configuration
return result.ToString().TrimEnd('\n', '\r');
}
- internal bool IsNetworkAvailable()
+ internal async Task<bool> IsNetworkAvailable()
{
- try
+ string dns = GetCurrentSystemLang().Code switch
{
- string dns = GetCurrentSystemLang().Code switch
- {
- "fa" => "aparat.com",
- "zh" => "baidu.com",
- "ru" => "yandex.ru",
- "kk" => "yandex.kz",
- "ko" => "naver.com",
- "cs" => "seznam.cz",
- "tk" => "turkmenportal.com",
- "vi" => "fpt.vn",
- "es" => "terra.es",
- "ja" => "yahoo.co.jp",
- "de" => "t-online.de",
- "fr" => "orange.fr",
- "it" => "libero.it",
- "th" => "true.th",
- "pl" => "wp.pl",
- "nl" => "nu.nl",
- "pt" => "globo.com",
- "sv" => "aftonbladet.se",
- "no" => "vg.no",
- "fi" => "yle.fi",
- "ro" => "digisport.ro",
- "gr" => "in.gr",
- "id" => "detik.com",
- "mx" => "univision.com",
- "ar" => "claro.com.ar",
- string name when new[] { "tr", "hi", "ar" }.Contains(name) => "bing.com",
- _ => "google.com"
- };
-
- TimeSpan timeout = TimeSpan.FromSeconds(5.0);
-
- using Task<IPAddress> task = Task.Run(() =>
- {
- try { return Dns.GetHostEntry(dns).AddressList[0]; }
- catch { return null; }
- });
-
- if (!task.Wait(timeout) || task.Result == null)
- {
- return false;
- }
+ "fa" => "aparat.com",
+ "zh" => "baidu.com",
+ "ru" => "yandex.ru",
+ "kk" => "yandex.kz",
+ "ko" => "naver.com",
+ "cs" => "seznam.cz",
+ "tk" => "turkmenportal.com",
+ "vi" => "fpt.vn",
+ "es" => "terra.es",
+ "ja" => "yahoo.co.jp",
+ "de" => "t-online.de",
+ "fr" => "orange.fr",
+ "it" => "libero.it",
+ "th" => "true.th",
+ "pl" => "wp.pl",
+ "nl" => "nu.nl",
+ "pt" => "globo.com",
+ "sv" => "aftonbladet.se",
+ "no" => "vg.no",
+ "fi" => "yle.fi",
+ "ro" => "digisport.ro",
+ "gr" => "in.gr",
+ "id" => "detik.com",
+ "mx" => "univision.com",
+ "ar" => "claro.com.ar",
+ string name when new[] { "tr", "hi", "ar" }.Contains(name) => "bing.com",
+ _ => "google.com"
+ };
+
+ Task<IPHostEntry> dnsTask = Dns.GetHostEntryAsync(dns);
+ Task timeoutTask = Task.Delay(TimeSpan.FromSeconds(5));
+
+ if (await Task.WhenAny(dnsTask, timeoutTask) == timeoutTask) { return false; }
- return true;
+ try
+ {
+ IPHostEntry entry = await dnsTask;
+ return entry?.AddressList?.Length > 0;
}
catch { return false; }
}
- internal void GetUserIpAddress()
+ internal async Task GetUserIpAddress()
{
- if (IsNetworkAvailable())
+ if (await IsNetworkAvailable())
{
bool hadLimited = false, hadBlock = false;
- using HttpClient client = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
-
foreach (string url in PathLocator.Links.IpServices)
{
try
{
- using HttpResponseMessage response = client.GetAsync(url).GetAwaiter().GetResult();
+ using HttpResponseMessage response = await sharedClient.GetAsync(url);
if (!response.IsSuccessStatusCode)
{
@@ -683,18 +676,17 @@ namespace GTweak.Utilities.Configuration
continue;
}
- IPMetadata ipMetadata = IPMetadata.ParseData(response.Content.ReadAsStringAsync().GetAwaiter().GetResult());
+ string content = await response.Content.ReadAsStringAsync();
+ IPMetadata ipMetadata = IPMetadata.ParseData(content);
- if (IPAddress.TryParse(ipMetadata.Ip, out _) && !string.IsNullOrWhiteSpace(ipMetadata?.Ip) && !string.IsNullOrWhiteSpace(ipMetadata?.Country))
+ if (ipMetadata != null && !string.IsNullOrWhiteSpace(ipMetadata.Ip) && !string.IsNullOrWhiteSpace(ipMetadata.Country) && IPAddress.TryParse(ipMetadata.Ip, out _))
{
CurrentConnection = ConnectionStatus.Available;
UserIPAddress = $"{ipMetadata.Ip} ({ipMetadata.Country})";
break;
}
- else
- {
- hadBlock = true;
- }
+
+ hadBlock = true;
}
catch { hadLimited = true; }
}
@@ -721,69 +713,67 @@ namespace GTweak.Utilities.Configuration
}
if (new Dictionary<ConnectionStatus, string>
- {
- { ConnectionStatus.Lose, "connection_lose_sysinfo" },
- { ConnectionStatus.Block, "connection_block_sysinfo" },
- { ConnectionStatus.Limited, "connection_limited_sysinfo" }
- }.TryGetValue(CurrentConnection, out string resourceKey)) { UserIPAddress = (string)Application.Current.Resources[resourceKey]; }
+ {
+ { ConnectionStatus.Lose, "connection_lose_sysinfo" },
+ { ConnectionStatus.Block, "connection_block_sysinfo" },
+ { ConnectionStatus.Limited, "connection_limited_sysinfo" }
+ }.TryGetValue(CurrentConnection, out string resourceKey)) { UserIPAddress = (string)Application.Current.Resources[resourceKey]; }
isIPAddressFormatValid = UserIPAddress.Any(char.IsDigit);
}
- internal void ValidateVersionUpdates()
+ internal async Task ValidateVersionUpdates()
{
- if (!SettingsEngine.IsUpdateCheckRequired || !IsNetworkAvailable())
- {
- return;
- }
-
- foreach (string api in PathLocator.Links.ReleaseApi)
+ if (SettingsEngine.IsUpdateCheckRequired && await IsNetworkAvailable())
{
- try
+ foreach (string api in PathLocator.Links.ReleaseApi)
{
- HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(api);
- webRequest.ContentType = "application/json";
- webRequest.UserAgent = "Nothing";
- webRequest.Timeout = 5000;
-
- using HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();
- using StreamReader reader = new StreamReader(response.GetResponseStream());
- string json = reader.ReadToEnd();
- GitMetadata latest = null;
-
- if (api.Contains("github"))
- {
- latest = JsonConvert.DeserializeObject<GitMetadata>(json);
- }
- else
+ try
{
- List<GitLabMetadata> releases = JsonConvert.DeserializeObject<List<GitLabMetadata>>(json);
- latest = releases?.FirstOrDefault();
+ HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(api);
+ webRequest.ContentType = "application/json";
+ webRequest.UserAgent = "Nothing";
+ webRequest.Timeout = 5000;
+
+ using HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();
+ using StreamReader reader = new StreamReader(response.GetResponseStream());
+ string json = reader.ReadToEnd();
+ GitMetadata latest = null;
- if (latest != null && !string.IsNullOrEmpty(((GitLabMetadata)latest).Description))
+ if (api.Contains("github"))
{
- GitLabMetadata gitLabMetadata = (GitLabMetadata)latest;
- Match match = Regex.Match(gitLabMetadata.Description, @"\[(?<name>.*?)\]\(/uploads/(?<hash>.+?)\)");
+ latest = JsonConvert.DeserializeObject<GitMetadata>(json);
+ }
+ else
+ {
+ List<GitLabMetadata> releases = JsonConvert.DeserializeObject<List<GitLabMetadata>>(json);
+ latest = releases?.FirstOrDefault();
- if (match.Success)
+ if (latest != null && !string.IsNullOrEmpty(((GitLabMetadata)latest).Description))
{
- string hashFile = match.Groups["hash"].Value;
- PathLocator.Links.GitLabLatest = (true, $"{PathLocator.Links.GitLabLatest.Url}{hashFile}");
+ GitLabMetadata gitLabMetadata = (GitLabMetadata)latest;
+ Match match = Regex.Match(gitLabMetadata.Description, @"\[(?<name>.*?)\]\(/uploads/(?<hash>.+?)\)");
+
+ if (match.Success)
+ {
+ string hashFile = match.Groups["hash"].Value;
+ PathLocator.Links.GitLabLatest = (true, $"{PathLocator.Links.GitLabLatest.Url}{hashFile}");
+ }
}
}
- }
- if (latest != null && !string.IsNullOrWhiteSpace(latest.CurrentVersion))
- {
- if (new Version(latest.CurrentVersion) > new Version(SettingsEngine.currentRelease))
+ if (latest != null && !string.IsNullOrWhiteSpace(latest.CurrentVersion))
{
- IsNeedUpdate = true;
- DownloadVersion = latest.CurrentVersion;
- break;
+ if (new Version(latest.CurrentVersion) > new Version(SettingsEngine.currentRelease))
+ {
+ IsNeedUpdate = true;
+ DownloadVersion = latest.CurrentVersion;
+ break;
+ }
}
}
+ catch { continue; }
}
- catch { continue; }
}
}
}
diff --git a/.Source/GTweak/View/DataSystemView.xaml b/.Source/GTweak/View/DataSystemView.xaml
index ec50e980..47466878 100644
--- a/.Source/GTweak/View/DataSystemView.xaml
+++ b/.Source/GTweak/View/DataSystemView.xaml
@@ -53,7 +53,7 @@
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10,5,10,0">
- <Ellipse Height="90" Width="90" Stroke="{StaticResource Brush_Separator}" StrokeThickness="4" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="{StaticResource RadialProgress_Opacity}">
+ <Ellipse Height="90" Width="90" Stroke="{StaticResource Brush_Separator}" StrokeThickness="4" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="{StaticResource DataElement_Opacity}">
<Ellipse.CacheMode>
<BitmapCache RenderAtScale="2"/>
</Ellipse.CacheMode>
@@ -94,7 +94,7 @@
<ImageBrush ImageSource="{StaticResource Icon_LogoWin}" Stretch="Uniform"/>
</Border.OpacityMask>
<Border.Effect>
- <DropShadowEffect Opacity="0.5" BlurRadius="10" ShadowDepth="10"/>
+ <DropShadowEffect Opacity="{StaticResource DataElement_Opacity}" BlurRadius="10" ShadowDepth="10"/>
</Border.Effect>
</Border>
@@ -119,7 +119,7 @@
</Grid>
<Grid Grid.Column="2" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="10,5,15,0">
- <Ellipse Height="90" Width="90" Stroke="{StaticResource Brush_Separator}" StrokeThickness="4" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="{StaticResource RadialProgress_Opacity}">
+ <Ellipse Height="90" Width="90" Stroke="{StaticResource Brush_Separator}" StrokeThickness="4" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="{StaticResource DataElement_Opacity}">
<Ellipse.CacheMode>
<BitmapCache RenderAtScale="2" EnableClearType="True"/>
</Ellipse.CacheMode>
diff --git a/.Source/GTweak/View/DataSystemView.xaml.cs b/.Source/GTweak/View/DataSystemView.xaml.cs
index 78783745..ae3230ba 100644
--- a/.Source/GTweak/View/DataSystemView.xaml.cs
+++ b/.Source/GTweak/View/DataSystemView.xaml.cs
@@ -78,7 +78,7 @@ namespace GTweak.View
}
else if ((int)time.TotalSeconds % 5 == 0)
{
- await backgroundQueue.QueueTask(delegate { _systemDataCollector.GetUserIpAddress(); });
+ await backgroundQueue.QueueTask(async delegate { await _systemDataCollector.GetUserIpAddress(); });
_ = Dispatcher.BeginInvoke(new Action(() => { DataContext = new DataSystemViewModel(); }));
}
_ = Dispatcher.BeginInvoke(new Action(() =>
diff --git a/.Source/GTweak/View/UtilsView.xaml.cs b/.Source/GTweak/View/UtilsView.xaml.cs
index 6e1eeec4..3b3c7f0e 100644
--- a/.Source/GTweak/View/UtilsView.xaml.cs
+++ b/.Source/GTweak/View/UtilsView.xaml.cs
@@ -33,7 +33,7 @@ namespace GTweak.View
}
else
{
- if (new SystemDataCollector().IsNetworkAvailable())
+ if (await new SystemDataCollector().IsNetworkAvailable())
{
await WinLicenseHandler.StartActivation();
}
diff --git a/.Source/GTweak/Windows/LoadingWindow.xaml.cs b/.Source/GTweak/Windows/LoadingWindow.xaml.cs
index 56b0c607..de814393 100644
--- a/.Source/GTweak/Windows/LoadingWindow.xaml.cs
+++ b/.Source/GTweak/Windows/LoadingWindow.xaml.cs
@@ -54,8 +54,7 @@ namespace GTweak.Windows
ExecuteWithLogging(TrustedInstaller.StartTrustedInstallerService, nameof(TrustedInstaller.StartTrustedInstallerService));
ExecuteWithLogging(WinLicenseHandler.LicenseStatus, nameof(WinLicenseHandler.LicenseStatus));
- ExecuteWithLogging(() => _systemDataCollector.GetHardwareData(), nameof(_systemDataCollector.GetHardwareData));
- ExecuteWithLogging(_systemDataCollector.ValidateVersionUpdates, nameof(_systemDataCollector.ValidateVersionUpdates));
+ ExecuteWithLogging(_systemDataCollector.GetHardwareData, nameof(_systemDataCollector.GetHardwareData));
ExecuteWithLogging(_uninstallingPakages.GetInstalledPackages, nameof(_uninstallingPakages.GetInstalledPackages));
ExecuteWithLogging(UninstallingPakages.CheckingForLocalAccount, nameof(UninstallingPakages.CheckingForLocalAccount));
ExecuteWithLogging(SystemTweaks.ViewNetshState, nameof(SystemTweaks.ViewNetshState));
@@ -63,6 +62,7 @@ namespace GTweak.Windows
ExecuteWithLogging(SystemTweaks.ViewConfigTick, nameof(SystemTweaks.ViewConfigTick));
ExecuteWithLogging(() => HardwareData.RunningProcessesCount = _systemDataCollector.GetProcessCount().GetAwaiter().GetResult(), nameof(_systemDataCollector.GetProcessCount));
ExecuteWithLogging(() => HardwareData.RunningServicesCount = _systemDataCollector.GetServicesCount().GetAwaiter().GetResult(), nameof(_systemDataCollector.GetServicesCount));
+ ExecuteWithLogging(() => _systemDataCollector.ValidateVersionUpdates().GetAwaiter().GetResult(), nameof(_systemDataCollector.ValidateVersionUpdates));
ExecuteWithLogging(() => _systemDataCollector.GetTotalProcessorUsage().GetAwaiter().GetResult(), nameof(_systemDataCollector.GetTotalProcessorUsage));
ExecuteWithLogging(() => _systemDataCollector.GetPhysicalAvailableMemory().GetAwaiter().GetResult(), nameof(_systemDataCollector.GetPhysicalAvailableMemory));
ExecuteWithLogging(RunGuard.CheckingDefenderExclusions, nameof(RunGuard.CheckingDefenderExclusions));
diff --git a/.Source/GTweak/Windows/MainWindow.xaml b/.Source/GTweak/Windows/MainWindow.xaml
index a39498b8..2befaed2 100644
--- a/.Source/GTweak/Windows/MainWindow.xaml
+++ b/.Source/GTweak/Windows/MainWindow.xaml
@@ -244,7 +244,7 @@
</ScrollViewer>
</Border>
- <Border Background="#33000000" Opacity="0.7" CornerRadius="10" Margin="10,15,0,50" IsHitTestVisible="False">
+ <Border Background="{StaticResource Brush_ShadowOverlay}" Opacity="0.7" CornerRadius="10" Margin="10,15,0,50" IsHitTestVisible="False">
<Border.RenderTransform>
<TranslateTransform X="2" Y="4" />
</Border.RenderTransform>
@@ -301,7 +301,7 @@
<TranslateTransform Y="-20"/>
</Grid.RenderTransform>
- <Border Background="#33000000" Opacity="0.7" IsHitTestVisible="False" CornerRadius="10" Panel.ZIndex="0">
+ <Border Background="{StaticResource Brush_ShadowOverlay}" Opacity="0.7" IsHitTestVisible="False" CornerRadius="10" Panel.ZIndex="0">
<Border.RenderTransform>
<TranslateTransform X="3" Y="4"/>
</Border.RenderTransform>