Remove qt_mac_applicationIsInDarkMode in favour of QStyleHints::colorScheme()
Now that we have the information available in QStyleHints we don't need to expose it as a dedicated helper function, and definitely not in QtCore. Change-Id: If5ad3991d78810457b51a30aadc3bf3af593940c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
a7136c3e7b
commit
48f161e129
@ -323,13 +323,6 @@ QDebug operator<<(QDebug debug, const QCFString &string)
|
|||||||
#endif // !QT_NO_DEBUG_STREAM
|
#endif // !QT_NO_DEBUG_STREAM
|
||||||
|
|
||||||
#if defined(Q_OS_MACOS) && !defined(QT_BOOTSTRAPPED)
|
#if defined(Q_OS_MACOS) && !defined(QT_BOOTSTRAPPED)
|
||||||
bool qt_mac_applicationIsInDarkMode()
|
|
||||||
{
|
|
||||||
auto appearance = [NSApp.effectiveAppearance bestMatchFromAppearancesWithNames:
|
|
||||||
@[ NSAppearanceNameAqua, NSAppearanceNameDarkAqua ]];
|
|
||||||
return [appearance isEqualToString:NSAppearanceNameDarkAqua];
|
|
||||||
}
|
|
||||||
|
|
||||||
bool qt_mac_runningUnderRosetta()
|
bool qt_mac_runningUnderRosetta()
|
||||||
{
|
{
|
||||||
int translated = 0;
|
int translated = 0;
|
||||||
|
@ -185,7 +185,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#ifdef Q_OS_MACOS
|
#ifdef Q_OS_MACOS
|
||||||
Q_CORE_EXPORT bool qt_mac_applicationIsInDarkMode();
|
|
||||||
Q_CORE_EXPORT bool qt_mac_runningUnderRosetta();
|
Q_CORE_EXPORT bool qt_mac_runningUnderRosetta();
|
||||||
Q_CORE_EXPORT std::optional<uint32_t> qt_mac_sipConfiguration();
|
Q_CORE_EXPORT std::optional<uint32_t> qt_mac_sipConfiguration();
|
||||||
#ifdef QT_BUILD_INTERNAL
|
#ifdef QT_BUILD_INTERNAL
|
||||||
|
@ -505,7 +505,10 @@ void QCocoaTheme::requestColorScheme(Qt::ColorScheme scheme)
|
|||||||
*/
|
*/
|
||||||
void QCocoaTheme::updateColorScheme()
|
void QCocoaTheme::updateColorScheme()
|
||||||
{
|
{
|
||||||
m_colorScheme = qt_mac_applicationIsInDarkMode() ? Qt::ColorScheme::Dark : Qt::ColorScheme::Light;
|
auto appearance = [NSApp.effectiveAppearance bestMatchFromAppearancesWithNames:
|
||||||
|
@[ NSAppearanceNameAqua, NSAppearanceNameDarkAqua ]];
|
||||||
|
m_colorScheme = [appearance isEqualToString:NSAppearanceNameDarkAqua] ?
|
||||||
|
Qt::ColorScheme::Dark : Qt::ColorScheme::Light;
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt::ContrastPreference QCocoaTheme::contrastPreference() const
|
Qt::ContrastPreference QCocoaTheme::contrastPreference() const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user