qt: adapt to latest qt dev code
It was decided to rename the property from Appearance to ColorScheme. Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
8bd2a777d1
commit
9bf6361171
|
@ -355,8 +355,8 @@ void FramelessManagerPrivate::initialize()
|
|||
QStyleHints * const styleHints = QGuiApplication::styleHints();
|
||||
Q_ASSERT(styleHints);
|
||||
if (styleHints) {
|
||||
connect(styleHints, &QStyleHints::appearanceChanged, this, [this](const Qt::Appearance appearance){
|
||||
Q_UNUSED(appearance);
|
||||
connect(styleHints, &QStyleHints::colorSchemeChanged, this, [this](const Qt::ColorScheme colorScheme){
|
||||
Q_UNUSED(colorScheme);
|
||||
notifySystemThemeHasChangedOrNot();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -282,7 +282,7 @@ QColor Utils::calculateSystemButtonBackgroundColor(const SystemButtonType button
|
|||
bool Utils::shouldAppsUseDarkMode()
|
||||
{
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
|
||||
return (QGuiApplication::styleHints()->appearance() == Qt::Appearance::Dark);
|
||||
return (QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark);
|
||||
#elif ((QT_VERSION >= QT_VERSION_CHECK(6, 2, 1)) && !defined(FRAMELESSHELPER_CORE_NO_PRIVATE))
|
||||
if (const QPlatformTheme * const theme = QGuiApplicationPrivate::platformTheme()) {
|
||||
return (theme->appearance() == QPlatformTheme::Appearance::Dark);
|
||||
|
|
Loading…
Reference in New Issue