QWindowsVistaStyle: Fill menu popup with theme color

The background for menu items is not drawn and can lead to a transparent
background when switching from QWindows11Style to QWindowVistaStyle at
runtime. This patch fills the background of menu items with
MENU_POPUPBACKGROUND.

Fixes: QTBUG-125474
Change-Id: I246db15ec821f9bc46ba410293c41b7e24548716
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 3de6d6fd348668ff5179504e950ce20b15075391)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Wladimir Leuschner 2024-05-31 10:59:37 +02:00 committed by Qt Cherry-pick Bot
parent 8f89f45f42
commit b33e0eac97

View File

@ -2836,6 +2836,11 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
}
QRect rect = option->rect;
//fill popup background
QWindowsThemeData popupbackgroundTheme(widget, painter, QWindowsVistaStylePrivate::MenuTheme,
MENU_POPUPBACKGROUND, stateId, option->rect);
d->drawBackground(popupbackgroundTheme);
//draw vertical menu line
if (option->direction == Qt::LeftToRight)
checkcol += rect.x();