diff src/gui/theme.cc @ 351:c844f8bb87ce

gui/theme: add xsettings backend this also adds newly-necessary endianness methods in core/endian.h which just so happen to be constexpr as well
author Paper <paper@paper.us.eu.org>
date Sun, 14 Jul 2024 23:23:56 -0400
parents 91ac90a34003
children
line wrap: on
line diff
--- a/src/gui/theme.cc	Sun Jul 14 19:12:40 2024 -0400
+++ b/src/gui/theme.cc	Sun Jul 14 23:23:56 2024 -0400
@@ -16,6 +16,9 @@
 #	ifdef GLIB
 #		include "sys/glib/dark_theme.h"
 #	endif
+#	ifdef HAVE_XCB
+#		include "sys/x11/dark_theme.h"
+#	endif
 #endif
 
 /* Weird quirks of this implementation:
@@ -45,11 +48,18 @@
 			if (win32::DarkThemeAvailable())
 				return win32::IsInDarkTheme();
 #else
-#	ifdef GLIB
-			return glib::IsInDarkTheme();
+#	ifdef HAVE_XCB
+			if (x11::IsInDarkTheme())
+				return true;
 #	endif
+#	ifdef GLIB
+			if (glib::IsInDarkTheme())
+				return true;
+#	endif
+			break;
 #endif
-		default: break;
+		default:
+			break;
 	}
 	return (theme == Theme::Dark);
 }