diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-11-16 10:24:53 (GMT) |
---|---|---|
committer | Qt Commercial Integration <QtCommercial@digia.com> | 2012-01-31 10:24:51 (GMT) |
commit | bdaf3903545e9f1fbd70008ad6a506a650e1afb8 (patch) | |
tree | 442667bbfdecd79bdc67cf22ea1946de0ae76a81 /src/gui | |
parent | 6635746b9c214d8c5d38c846d3ce049118d818b3 (diff) | |
download | Qt-bdaf3903545e9f1fbd70008ad6a506a650e1afb8.zip Qt-bdaf3903545e9f1fbd70008ad6a506a650e1afb8.tar.gz Qt-bdaf3903545e9f1fbd70008ad6a506a650e1afb8.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')
-rw-r--r-- | src/gui/kernel/qwidget_win.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 55cfed8..fd3643c 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; |