diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2014-03-03 16:43:58 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-04 11:29:30 +0100 |
commit | e7874563e402030433e9b96b11b14bb38cdad3a8 (patch) | |
tree | 6aa81dd6a6c1b7152b5fa29e8304ef4d3ba6780e /src/widgets/styles | |
parent | 28c9c2ea50e54236d5975f263ee1d28d831223aa (diff) |
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>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qwindowsvistastyle.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index 6c7b71bd74..f93e9312de 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -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) |