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
18 changes: 18 additions & 0 deletions platformthemeplugin/qdeepintheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,24 @@ const QPalette *QDeepinTheme::palette(QPlatformTheme::Palette type) const
return &palette;
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
Qt::ColorScheme QDeepinTheme::colorScheme() const
{
auto *helper = DGuiApplicationHelper::instance();
if (!helper)
return QGenericUnixTheme::colorScheme();

switch (helper->themeType()) {
case DGuiApplicationHelper::DarkType:
return Qt::ColorScheme::Dark;
case DGuiApplicationHelper::LightType:
return Qt::ColorScheme::Light;
default:
return Qt::ColorScheme::Unknown;
}
}
#endif

static QFont *createUnresolveFont(const QString &family, qreal pointSize)
{
auto font = new QFont(family);
Expand Down
3 changes: 3 additions & 0 deletions platformthemeplugin/qdeepintheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ class QDeepinTheme : public QGenericUnixTheme

QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE;
const QPalette *palette(Palette type) const override;
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
Qt::ColorScheme colorScheme() const override;
#endif
const QFont *font(Font type) const Q_DECL_OVERRIDE;
DThemeSettings *settings() const;
static DThemeSettings *getSettings();
Expand Down
Loading