From 67c835d201e52156afe3e5ec94772e7872e73743 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Fri, 2 Sep 2022 22:23:55 +0800 Subject: [PATCH] QWindowsKeyMapper: simplify the code a bit (2/2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The default menu item will appear in bold font, and calling SetMenuDefaultItem() can do the job for us. Use it instead of calling SetMenuItemInfo() to save some typings. Change-Id: Ifa834adc45f3aafd67077c089fb4e7b5d3fd3e02 Reviewed-by: MÃ¥rten Nordheim --- src/plugins/platforms/windows/qwindowskeymapper.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index 1b47aa095d..947fbf3f37 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -798,11 +798,7 @@ static void showSystemMenu(QWindow* w) HiliteMenuItem(topLevelHwnd, menu, SC_RESTORE, MF_BYCOMMAND | MFS_HILITE); // Set bold on close menu item - MENUITEMINFO closeItem; - closeItem.cbSize = sizeof(MENUITEMINFO); - closeItem.fMask = MIIM_STATE; - closeItem.fState = MFS_DEFAULT; - SetMenuItemInfo(menu, SC_CLOSE, FALSE, &closeItem); + SetMenuDefaultItem(menu, SC_CLOSE, FALSE); #undef enabled #undef disabled