diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2009-11-11 14:58:58 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2009-11-11 15:03:06 (GMT) |
commit | de789420c1918f30c276113ebfc056c620f341cc (patch) | |
tree | 855e1799f27a82dcfd48aab946c83bad3aed8f78 /src | |
parent | 747ee16fe763725451d05126d9a9a49a87627210 (diff) | |
download | Qt-de789420c1918f30c276113ebfc056c620f341cc.zip Qt-de789420c1918f30c276113ebfc056c620f341cc.tar.gz Qt-de789420c1918f30c276113ebfc056c620f341cc.tar.bz2 |
Improved compatibility with MDI area custom themes on XP
With certain custom Windows themes the window mask will be
incorrectly set so that the subwindows become unusable.
Instead of passing the window rect to the mask region
function, we now only pass only the title bar rect and add
the remainder at the bottom. This should improve
compatibility with certain custom themes such as the
Vista Inspirat Pack.
Task-id: QTBUG-6271
Reviewed-by: prasanth
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/styles/qwindowsxpstyle.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp index fe7f5d7..54f2964 100644 --- a/src/gui/styles/qwindowsxpstyle.cpp +++ b/src/gui/styles/qwindowsxpstyle.cpp @@ -3780,12 +3780,19 @@ int QWindowsXPStyle::styleHint(StyleHint hint, const QStyleOption *option, const QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask *>(returnData); const QStyleOptionTitleBar *titlebar = qstyleoption_cast<const QStyleOptionTitleBar *>(option); if (mask && titlebar) { + // Note certain themes will not return the whole window frame but only the titlebar part when + // queried This function needs to return the entire window mask, hence we will only fetch the mask for the + // titlebar itself and add the remaining part of the window rect at the bottom. + int tbHeight = proxy()->pixelMetric(PM_TitleBarHeight, option, widget); + QRect titleBarRect = option->rect; + titleBarRect.setHeight(tbHeight); XPThemeData themeData; if (titlebar->titleBarState & Qt::WindowMinimized) { - themeData = XPThemeData(widget, 0, QLatin1String("WINDOW"), WP_MINCAPTION, CS_ACTIVE, option->rect); + themeData = XPThemeData(widget, 0, QLatin1String("WINDOW"), WP_MINCAPTION, CS_ACTIVE, titleBarRect); } else - themeData = XPThemeData(widget, 0, QLatin1String("WINDOW"), WP_CAPTION, CS_ACTIVE, option->rect); - mask->region = d->region(themeData); + themeData = XPThemeData(widget, 0, QLatin1String("WINDOW"), WP_CAPTION, CS_ACTIVE, titleBarRect); + mask->region = d->region(themeData) + + QRect(0, tbHeight, option->rect.width(), option->rect.height() - tbHeight); } } break; |