Mercurial > minori
comparison 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 |
comparison
equal
deleted
inserted
replaced
350:daa03aa2262d | 351:c844f8bb87ce |
---|---|
13 #elif defined(WIN32) | 13 #elif defined(WIN32) |
14 # include "sys/win32/dark_theme.h" | 14 # include "sys/win32/dark_theme.h" |
15 #else | 15 #else |
16 # ifdef GLIB | 16 # ifdef GLIB |
17 # include "sys/glib/dark_theme.h" | 17 # include "sys/glib/dark_theme.h" |
18 # endif | |
19 # ifdef HAVE_XCB | |
20 # include "sys/x11/dark_theme.h" | |
18 # endif | 21 # endif |
19 #endif | 22 #endif |
20 | 23 |
21 /* Weird quirks of this implementation: | 24 /* Weird quirks of this implementation: |
22 * 1. Dark mode stuff in Qt changes a lot and Qt 5 and Qt 6 are massively different | 25 * 1. Dark mode stuff in Qt changes a lot and Qt 5 and Qt 6 are massively different |
43 return osx::IsInDarkTheme(); | 46 return osx::IsInDarkTheme(); |
44 #elif defined(WIN32) | 47 #elif defined(WIN32) |
45 if (win32::DarkThemeAvailable()) | 48 if (win32::DarkThemeAvailable()) |
46 return win32::IsInDarkTheme(); | 49 return win32::IsInDarkTheme(); |
47 #else | 50 #else |
51 # ifdef HAVE_XCB | |
52 if (x11::IsInDarkTheme()) | |
53 return true; | |
54 # endif | |
48 # ifdef GLIB | 55 # ifdef GLIB |
49 return glib::IsInDarkTheme(); | 56 if (glib::IsInDarkTheme()) |
57 return true; | |
50 # endif | 58 # endif |
59 break; | |
51 #endif | 60 #endif |
52 default: break; | 61 default: |
62 break; | |
53 } | 63 } |
54 return (theme == Theme::Dark); | 64 return (theme == Theme::Dark); |
55 } | 65 } |
56 | 66 |
57 void ThemeManager::SetToDarkTheme() { | 67 void ThemeManager::SetToDarkTheme() { |