diff options
author | Joerg Bornemann <joerg.bornemann@nokia.com> | 2010-07-16 08:43:14 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-07-18 03:04:33 (GMT) |
commit | 67eaa50ad5ae1543fd165ac6ce29accfcc428036 (patch) | |
tree | baee2d9b26df5a935b485c3dacf82b25d528c0cd /src/gui | |
parent | 259003d8f074d6a200fae56a38992531e6a55115 (diff) | |
download | Qt-67eaa50ad5ae1543fd165ac6ce29accfcc428036.zip Qt-67eaa50ad5ae1543fd165ac6ce29accfcc428036.tar.gz Qt-67eaa50ad5ae1543fd165ac6ce29accfcc428036.tar.bz2 |
Windows mobile: hide [X] button in task bar on unmaximize
When calling showNormal on a window that was maximized, we must remove
the [X] button from the task bar. But only if it was added by
qt_wince_maximize.
Task-number: QTBUG-8408
Reviewed-by: Martin Petersson
(cherry picked from commit ad4aff6e2d188d88a2c6b4b692932adb08491d22)
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qguifunctions_wince.cpp | 17 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_win.cpp | 1 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_wince.cpp | 1 |
3 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/kernel/qguifunctions_wince.cpp b/src/gui/kernel/qguifunctions_wince.cpp index ab1a655..01ff3cd 100644 --- a/src/gui/kernel/qguifunctions_wince.cpp +++ b/src/gui/kernel/qguifunctions_wince.cpp @@ -76,6 +76,10 @@ struct AygSIPINFO #define SHIDIF_SIZEDLGFULLSCREEN 0x0004 #endif +#ifndef SHDB_HIDE +#define SHDB_HIDE 0x0002 +#endif + #ifndef SHFS_SHOWTASKBAR #define SHFS_SHOWTASKBAR 0x0001 #endif @@ -112,10 +116,12 @@ struct AygSIPINFO typedef BOOL (*AygInitDialog)(AygSHINITDLGINFO*); typedef BOOL (*AygFullScreen)(HWND, DWORD); typedef BOOL (*AygSHSipInfo)(UINT, UINT, PVOID, UINT); +typedef BOOL (*AygSHDoneButton)(HWND, DWORD); static AygInitDialog ptrAygInitDialog = 0; static AygFullScreen ptrAygFullScreen = 0; static AygSHSipInfo ptrAygSHSipInfo = 0; +static AygSHDoneButton ptrAygSHDoneButton = 0; static bool aygResolved = false; static void resolveAygLibs() @@ -128,6 +134,7 @@ static void resolveAygLibs() ptrAygInitDialog = (AygInitDialog) ayglib.resolve("SHInitDialog"); ptrAygFullScreen = (AygFullScreen) ayglib.resolve("SHFullScreen"); ptrAygSHSipInfo = (AygSHSipInfo) ayglib.resolve("SHSipInfo"); + ptrAygSHDoneButton = (AygSHDoneButton) ayglib.resolve("SHDoneButton"); } } @@ -336,6 +343,16 @@ void qt_wince_maximize(QWidget *widget) } } +void qt_wince_unmaximize(QWidget *widget) +{ + if (ptrAygSHDoneButton && qt_wince_is_mobile() + && !(widget->windowFlags() & (Qt::WindowCancelButtonHint | Qt::WindowOkButtonHint))) + { + // Hide the [X] button, we've added in qt_wince_maximize. + ptrAygSHDoneButton(widget->winId(), SHDB_HIDE); + } +} + void qt_wince_minimize(HWND hwnd) { #ifdef Q_OS_WINCE_WM diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 0f05c6b..23f57da 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -70,6 +70,7 @@ #include "qguifunctions_wince.h" QT_USE_NAMESPACE extern void qt_wince_maximize(QWidget *widget); //defined in qguifunctions_wince.cpp +extern void qt_wince_unmaximize(QWidget *widget); //defined in qguifunctions_wince.cpp extern void qt_wince_minimize(HWND hwnd); //defined in qguifunctions_wince.cpp extern void qt_wince_full_screen(HWND hwnd, bool fullScreen, UINT swpf); //defined in qguifunctions_wince.cpp extern bool qt_wince_is_mobile(); //defined in qguifunctions_wince.cpp diff --git a/src/gui/kernel/qwidget_wince.cpp b/src/gui/kernel/qwidget_wince.cpp index fc1e52c..76532ed 100644 --- a/src/gui/kernel/qwidget_wince.cpp +++ b/src/gui/kernel/qwidget_wince.cpp @@ -498,6 +498,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate) int style = GetWindowLong(internalWinId(), GWL_STYLE) | WS_BORDER | WS_POPUP | WS_CAPTION; SetWindowLong(internalWinId(), GWL_STYLE, style); SetWindowLong(internalWinId(), GWL_EXSTYLE, GetWindowLong (internalWinId(), GWL_EXSTYLE) & ~ WS_EX_NODRAG); + qt_wince_unmaximize(this); } if (isVisible() && newstate & Qt::WindowMaximized) qt_wince_maximize(this); |