diff options
author | Yuhang Zhao <2546789017@qq.com> | 2022-09-02 22:31:02 +0800 |
---|---|---|
committer | Yuhang Zhao <2546789017@qq.com> | 2022-09-19 18:14:13 +0800 |
commit | dfabeead97b639b3c418eea60ed4e09a0f982b8b (patch) | |
tree | 7f6b6cd753c6f1159c926e62e40e557424d6074b /src/plugins/platforms/windows/qwindowskeymapper.cpp | |
parent | bb582f7fd5073b11987f9d61511606422cf4e7c3 (diff) |
QWindowsKeyMapper: whitespace fixes
Code style fix, add some necessary whitespaces.
Change-Id: Ib6c5bf503faacec5dad804154ae992b2b0a49162
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowskeymapper.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowskeymapper.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index 273bed6767..1324ab52d1 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -781,16 +781,16 @@ static void showSystemMenu(QWindow* w) #define enabled (MF_BYCOMMAND | MF_ENABLED) #define disabled (MF_BYCOMMAND | MF_GRAYED) - EnableMenuItem(menu, SC_MINIMIZE, (topLevel->flags() & Qt::WindowMinimizeButtonHint)?enabled:disabled); + EnableMenuItem(menu, SC_MINIMIZE, (topLevel->flags() & Qt::WindowMinimizeButtonHint) ? enabled : disabled); bool maximized = IsZoomed(topLevelHwnd); - EnableMenuItem(menu, SC_MAXIMIZE, ! (topLevel->flags() & Qt::WindowMaximizeButtonHint) || maximized?disabled:enabled); + EnableMenuItem(menu, SC_MAXIMIZE, !(topLevel->flags() & Qt::WindowMaximizeButtonHint) || maximized ? disabled : enabled); // We should _not_ check with the setFixedSize(x,y) case here, since Windows is not able to check // this and our menu here would be out-of-sync with the menu produced by mouse-click on the // System Menu, or right-click on the title bar. - EnableMenuItem(menu, SC_SIZE, (topLevel->flags() & Qt::MSWindowsFixedSizeDialogHint) || maximized?disabled:enabled); - EnableMenuItem(menu, SC_MOVE, maximized?disabled:enabled); + EnableMenuItem(menu, SC_SIZE, (topLevel->flags() & Qt::MSWindowsFixedSizeDialogHint) || maximized ? disabled : enabled); + EnableMenuItem(menu, SC_MOVE, maximized ? disabled : enabled); EnableMenuItem(menu, SC_CLOSE, enabled); // Highlight the first entry in the menu, this is what native Win32 applications usually do. @@ -810,10 +810,11 @@ static void showSystemMenu(QWindow* w) #undef enabled #undef disabled + const QPoint pos = QHighDpi::toNativePixels(topLevel->geometry().topLeft(), topLevel); const int titleBarOffset = isSystemMenuOffsetNeeded(topLevel->flags()) ? getTitleBarHeight(topLevelHwnd) : 0; const int ret = TrackPopupMenuEx(menu, - TPM_LEFTALIGN | TPM_TOPALIGN | TPM_NONOTIFY | TPM_RETURNCMD, + TPM_LEFTALIGN | TPM_TOPALIGN | TPM_NONOTIFY | TPM_RETURNCMD, pos.x(), pos.y() + titleBarOffset, topLevelHwnd, nullptr); |