From 72678c462dfba421f357e65c8f4dec3bc55f6057 Mon Sep 17 00:00:00 2001 From: celeron533 Date: Thu, 11 Jul 2019 21:17:29 +0800 Subject: [PATCH] Print win10 theme info when verboseLogging switched on --- shadowsocks-csharp/Util/Util.cs | 9 ++++++--- shadowsocks-csharp/View/MenuViewController.cs | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/shadowsocks-csharp/Util/Util.cs b/shadowsocks-csharp/Util/Util.cs index 47b1a0b7..56f1e0b1 100755 --- a/shadowsocks-csharp/Util/Util.cs +++ b/shadowsocks-csharp/Util/Util.cs @@ -58,7 +58,7 @@ namespace Shadowsocks.Util public enum WindowsThemeMode { Dark, Light } // Support on Windows 10 1903+ - public static WindowsThemeMode GetWindows10SystemThemeSetting() + public static WindowsThemeMode GetWindows10SystemThemeSetting(bool isVerbose) { WindowsThemeMode themeMode = WindowsThemeMode.Dark; try @@ -78,8 +78,11 @@ namespace Shadowsocks.Util } catch { - Logging.Info( - $"Cannot get Windows 10 system theme mode, return default value 0 (dark mode)."); + if (isVerbose) + { + Logging.Info( + $"Cannot get Windows 10 system theme mode, return default value 0 (dark mode)."); + } } return themeMode; } diff --git a/shadowsocks-csharp/View/MenuViewController.cs b/shadowsocks-csharp/View/MenuViewController.cs index a1d2ef4f..5c64a558 100644 --- a/shadowsocks-csharp/View/MenuViewController.cs +++ b/shadowsocks-csharp/View/MenuViewController.cs @@ -220,7 +220,7 @@ namespace Shadowsocks.View { Color colorMask = Color.White; - Utils.WindowsThemeMode currentWindowsThemeMode = Utils.GetWindows10SystemThemeSetting(); + Utils.WindowsThemeMode currentWindowsThemeMode = Utils.GetWindows10SystemThemeSetting(controller.GetCurrentConfiguration().isVerboseLogging); if (isProxyEnabled) {