refactor: some Application & style things (#5561)

This commit is contained in:
pajlada
2024-08-25 15:33:07 +02:00
committed by GitHub
parent ac88730563
commit 627c735524
41 changed files with 733 additions and 678 deletions
+5 -3
View File
@@ -16,6 +16,7 @@
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
# include <QStyleHints>
#endif
#include <QApplication>
#include <cmath>
@@ -301,8 +302,9 @@ Theme::Theme(const Paths &paths)
this->loadAvailableThemes(paths);
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
QObject::connect(qApp->styleHints(), &QStyleHints::colorSchemeChanged,
&this->lifetime_, [this] {
QObject::connect(QApplication::styleHints(),
&QStyleHints::colorSchemeChanged, &this->lifetime_,
[this] {
if (this->isSystemTheme())
{
this->update();
@@ -320,7 +322,7 @@ void Theme::update()
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
if (this->isSystemTheme())
{
switch (qApp->styleHints()->colorScheme())
switch (QApplication::styleHints()->colorScheme())
{
case Qt::ColorScheme::Light:
return this->lightSystemThemeName;