Windows Vista Style: Don't draw menubar item background for QQ Controls

In QtQuick Controls, we draw the full menubar background and the menubar
items on top. Unless in a particular state, there's no need to draw the
background or it may overlap with the menubar edge.

Change-Id: Ia35a73274cc10b3b5a3f55573c92919f99555db0
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
This commit is contained in:
Gabriel de Dietrich 2014-03-03 16:43:58 +01:00 committed by The Qt Project
parent 28c9c2ea50
commit e7874563e4

View File

@ -1206,11 +1206,13 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
if (!proxy()->styleHint(SH_UnderlineShortcut, mbi, widget))
alignment |= Qt::TextHideMnemonic;
//The rect adjustment is a workaround for the menu not really filling its background.
XPThemeData theme(widget, painter,
QWindowsXPStylePrivate::MenuTheme,
MENU_BARBACKGROUND, 0, option->rect.adjusted(-1, 0, 2, 1));
d->drawBackground(theme);
if (widget) { // Not needed for QtQuick Controls
//The rect adjustment is a workaround for the menu not really filling its background.
XPThemeData theme(widget, painter,
QWindowsXPStylePrivate::MenuTheme,
MENU_BARBACKGROUND, 0, option->rect.adjusted(-1, 0, 2, 1));
d->drawBackground(theme);
}
int stateId = MBI_NORMAL;
if (disabled)