Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/clientdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1479,9 +1479,16 @@ void CClientDlg::SetMixerBoardDeco ( const ERecorderState newRecorderState, cons
}
else
{
if ( palette().color ( QPalette::Window ) == QColor::fromRgbF ( 0.196078, 0.196078, 0.196078, 1 ) )
#if QT_VERSION >= QT_VERSION_CHECK( 6, 5, 0 )
// for Qt 6.5.0 or later, we use the inbuilt cross platform color scheme picker.
if ( QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark )
#else
// for earlier versions, check darkmode as proposed in https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5
const QPalette defaultPalette;
if ( defaultPalette.color ( QPalette::WindowText ).lightness() > defaultPalette.color ( QPalette::Window ).lightness() )
#endif
{
// Dark mode on macOS/Linux needs a light color
// Dark mode needs a light color

sTitleStyle += "color: rgb(220,220,220); }";
}
Expand Down
3 changes: 3 additions & 0 deletions src/clientdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
#if QT_VERSION >= QT_VERSION_CHECK( 5, 6, 0 )
# include <QVersionNumber>
#endif
#if QT_VERSION >= QT_VERSION_CHECK( 6, 5, 0 )
# include <QStyleHints>
#endif
#include "global.h"
#include "util.h"
#include "client.h"
Expand Down
Loading