summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_win.cpp
diff options
context:
space:
mode:
authorPrasanth Ullattil <prasanth.ullattil@nokia.com>2010-11-16 10:24:53 (GMT)
committerPrasanth Ullattil <prasanth.ullattil@nokia.com>2010-11-16 10:37:59 (GMT)
commitc592b71d266a8f7a9bbf330fb3cbca168dbe1bfc (patch)
tree59a5c4d7e787cc6c9105050dbc55c53ba509bd48 /src/gui/kernel/qwidget_win.cpp
parent136cd834aba49904226f1be6c3077f45db78b0dc (diff)
downloadQt-c592b71d266a8f7a9bbf330fb3cbca168dbe1bfc.zip
Qt-c592b71d266a8f7a9bbf330fb3cbca168dbe1bfc.tar.gz
Qt-c592b71d266a8f7a9bbf330fb3cbca168dbe1bfc.tar.bz2
Use WS_POPUP window style more often on windows.
We dont use the WS_POPUP style when one of the following window flags are set (WindowSystemMenuHint, WindowTitleHint, WindowMinMaxButtonsHint WindowCloseButtonHint, WindowContextHelpButtonHint). None of these flags can conflict with this style, hence being removed. Task-number: QTBUG-10589 Reviewed-by: Denis
Diffstat (limited to 'src/gui/kernel/qwidget_win.cpp')
-rw-r--r--src/gui/kernel/qwidget_win.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp
index 39ed750..c358b9b 100644
--- a/src/gui/kernel/qwidget_win.cpp
+++ b/src/gui/kernel/qwidget_win.cpp
@@ -329,18 +329,11 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
if (topLevel) {
if ((type == Qt::Window || dialog || tool)) {
if (!(flags & Qt::FramelessWindowHint)) {
- if (!(flags & Qt::MSWindowsFixedSizeDialogHint)) {
+ style |= WS_POPUP;
+ if (!(flags & Qt::MSWindowsFixedSizeDialogHint))
style |= WS_THICKFRAME;
- if(!(flags &
- ( Qt::WindowSystemMenuHint
- | Qt::WindowTitleHint
- | Qt::WindowMinMaxButtonsHint
- | Qt::WindowCloseButtonHint
- | Qt::WindowContextHelpButtonHint)))
- style |= WS_POPUP;
- } else {
- style |= WS_POPUP | WS_DLGFRAME;
- }
+ else
+ style |= WS_DLGFRAME;
}
if (flags & Qt::WindowTitleHint)
style |= WS_CAPTION;
@@ -424,6 +417,14 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
if (!q->testAttribute(Qt::WA_Resized)) {
w = sw/2;
h = 4*sh/10;
+ if (extra) {
+ int dx = rect.right - rect.left;
+ int dy = rect.bottom - rect.top;
+ w = qMin(w, extra->maxw + dx);
+ h = qMin(h, extra->maxh + dy);
+ w = qMax(w, extra->minw + dx);
+ h = qMax(h, extra->minh + dy);
+ }
}
if (!wasMoved) {
x = sw/2 - w/2;