From f77b67db97487825d172401f118e205c6bae0510 Mon Sep 17 00:00:00 2001
From: affederaffe <68356204+affederaffe@users.noreply.github.com>
Date: Sun, 23 Apr 2023 22:32:51 +0200
Subject: [PATCH] Move comment
---
src/Avalonia.FreeDesktop/DBusPlatformSettings.cs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/Avalonia.FreeDesktop/DBusPlatformSettings.cs b/src/Avalonia.FreeDesktop/DBusPlatformSettings.cs
index 2b124499b3..8b2b38bb82 100644
--- a/src/Avalonia.FreeDesktop/DBusPlatformSettings.cs
+++ b/src/Avalonia.FreeDesktop/DBusPlatformSettings.cs
@@ -62,11 +62,6 @@ namespace Avalonia.FreeDesktop
switch (valueTuple)
{
case ("org.freedesktop.appearance", "color-scheme", { } colorScheme):
- /*
- 0: No preference
- 1: Prefer dark appearance
- 2: Prefer light appearance
- */
_themeVariant = ReadAsColorScheme(colorScheme);
_lastColorValues = BuildPlatformColorValues();
OnColorValuesChanged(_lastColorValues!);
@@ -92,6 +87,11 @@ namespace Avalonia.FreeDesktop
private static PlatformThemeVariant ReadAsColorScheme(DBusVariantItem value)
{
+ /*
+ 0: No preference
+ 1: Prefer dark appearance
+ 2: Prefer light appearance
+ */
var isDark = ((value.Value as DBusVariantItem)!.Value as DBusUInt32Item)!.Value == 1;
return isDark ? PlatformThemeVariant.Dark : PlatformThemeVariant.Light;
}