Skip to content

Commit

Permalink
QWindowsVistaStyle: Fill menu popup with theme color
Browse files Browse the repository at this point in the history
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 3de6d6f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
  • Loading branch information
Wladimir Leuschner authored and Qt Cherry-pick Bot committed Oct 9, 2024
1 parent 8f89f45 commit b33e0ea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plugins/styles/modernwindows/qwindowsvistastyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit b33e0ea

Please sign in to comment.