Decouple QApplication::isEffectEnabled from QColormap
Change-Id: I26468cc528d2c516492db11ca4109e6be63c1b5a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
parent
3056da6711
commit
c7625d14df
@ -3640,7 +3640,9 @@ void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable)
|
||||
bool QApplication::isEffectEnabled(Qt::UIEffect effect)
|
||||
{
|
||||
CHECK_QAPP_INSTANCE(false)
|
||||
return QColormap::instance().depth() >= 16
|
||||
const auto primaryScreenDepth = QGuiApplication::primaryScreen() ?
|
||||
QGuiApplication::primaryScreen()->depth() : 24;
|
||||
return primaryScreenDepth >= 16
|
||||
&& (QApplicationPrivate::enabledAnimations & QPlatformTheme::GeneralUiEffect)
|
||||
&& (QApplicationPrivate::enabledAnimations & uiEffectToFlag(effect));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user