Add connectToSignal on darkMode property fetch

Theme may be instantiated before the qApp is available

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-11-25 16:40:23 +08:00
parent 1db2656a4b
commit aceff3f529
No known key found for this signature in database
GPG Key ID: C839200C384636B0

View File

@ -1010,6 +1010,7 @@ QVariantMap Theme::systemPalette() const
bool Theme::darkMode() const
{
connectToPaletteSignal();
const auto isDarkFromStyle = [] {
switch (qGuiApp->styleHints()->colorScheme())
{