Skip to content

Commit

Permalink
Get system color scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
nrdrinkwater committed Nov 10, 2024
1 parent cabf807 commit 5950367
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions amalgam/amalgam.pro
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ DEFINES += QTWEBSOCKET # comment this line if QtWebsocket is unwanted
!lessThan(QT_MAJOR_VERSION, 6) {
DEFINES += QT60
!lessThan(QT_MINOR_VERSION,2): DEFINES += QT62
!lessThan(QT_MINOR_VERSION,5): DEFINES += QT65
!lessThan(QT_MINOR_VERSION,8): DEFINES += QT68
DEFINES += QT57
DEFINES += QT512
Expand Down
9 changes: 8 additions & 1 deletion lib/base/qtstate.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

#include <QApplication>
#include <QStyle>

#ifdef QT65
#include <QStyleHints>
#endif
#include "base.h"
#include "proj.h"
#include "recent.h"
Expand Down Expand Up @@ -49,6 +51,11 @@ std::string qtstate(std::string p)
c="style";
if (all || s.contains(c))
r+=qpair(c,QApplication::style()->objectName());
#ifdef QT65
c="colorscheme";
if (all || s.contains(c))
r+=qpair(c,i2s(Qt::ColorScheme::Dark == QGuiApplication::styleHints()->colorScheme()));
#endif
c="version";
if (all || s.contains(c))
r+=qpair(c,getversion());
Expand Down
1 change: 1 addition & 0 deletions lib/lib.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ DEFINES += QTWEBSOCKET # comment this line if QtWebsocket is unwanted
DEFINES += QT60
QT += core5compat
!lessThan(QT_MINOR_VERSION,2): DEFINES += QT62
!lessThan(QT_MINOR_VERSION,5): DEFINES += QT65
!lessThan(QT_MINOR_VERSION,8): DEFINES += QT68
DEFINES += QT57
DEFINES += QT512
Expand Down
1 change: 1 addition & 0 deletions main/main.pro
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ message(QMAKESPEC $$QMAKESPEC)
!lessThan(QT_MAJOR_VERSION, 6) {
DEFINES += QT60
!lessThan(QT_MINOR_VERSION,2): DEFINES += QT62
!lessThan(QT_MINOR_VERSION,5): DEFINES += QT65
!lessThan(QT_MINOR_VERSION,8): DEFINES += QT68
DEFINES += QT57
DEFINES += QT512
Expand Down

0 comments on commit 5950367

Please sign in to comment.