QWindows11Style: Fix QMessageBox drawing for light/dark mode
Fixes: QTBUG-120748 Change-Id: I4101848e2e91c489cb53b38ae6bf0171701c5c54 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 27dea6cf23c22c8ee2f82d97486f248559e57993) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
b2eb82a42f
commit
124e63965e
@ -765,6 +765,21 @@ void QWindows11Style::drawPrimitive(PrimitiveElement element, const QStyleOption
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case QStyle::PE_Widget: {
|
||||||
|
#if QT_CONFIG(dialogbuttonbox)
|
||||||
|
const QDialogButtonBox *buttonBox = nullptr;
|
||||||
|
if (qobject_cast<const QMessageBox *> (widget))
|
||||||
|
buttonBox = widget->findChild<const QDialogButtonBox *>(QLatin1String("qt_msgbox_buttonbox"));
|
||||||
|
#if QT_CONFIG(inputdialog)
|
||||||
|
else if (qobject_cast<const QInputDialog *> (widget))
|
||||||
|
buttonBox = widget->findChild<const QDialogButtonBox *>(QLatin1String("qt_inputdlg_buttonbox"));
|
||||||
|
#endif // QT_CONFIG(inputdialog)
|
||||||
|
if (buttonBox) {
|
||||||
|
painter->fillRect(option->rect,option->palette.window());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
QWindowsVistaStyle::drawPrimitive(element, option, painter, widget);
|
QWindowsVistaStyle::drawPrimitive(element, option, painter, widget);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user