From a32f58e73573f87c820784287b63cac76b42ae06 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 14 Jul 2018 22:37:33 +0300 Subject: in fact we need to do that only once, not during langpack reset --- src/mir_app/src/clui.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index c6798cb751..6b170e6edc 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -87,7 +87,7 @@ static int CluiIconsChanged(WPARAM, LPARAM) return 0; } -static int CluiLangpackChanged(WPARAM, LPARAM lParam) +static int CluiLangpackChanged(WPARAM, LPARAM) { if (g_clistApi.hMenuMain) { RemoveMenu(g_clistApi.hMenuMain, 0, MF_BYPOSITION); @@ -98,14 +98,7 @@ static int CluiLangpackChanged(WPARAM, LPARAM lParam) g_clistApi.hMenuMain = LoadMenu(g_plugin.getInst(), MAKEINTRESOURCE(IDR_CLISTMENU)); TranslateMenu(g_clistApi.hMenuMain); - MENUITEMINFO mii; - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_TYPE | MIIM_DATA; - mii.dwItemData = MENU_MIRANDAMENU; - mii.fType = MFT_OWNERDRAW; - SetMenuItemInfo(g_clistApi.hMenuMain, 0, TRUE, &mii); - - if (lParam || GetMenu(g_clistApi.hwndContactList)) + if (GetMenu(g_clistApi.hwndContactList)) SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain); return 0; } @@ -325,10 +318,19 @@ int LoadCLUIModule(void) SetParent(g_clistApi.hwndContactList, hProgMan); } - g_clistApi.pfnOnCreateClc(); - HookEvent(ME_LANGPACK_CHANGED, CluiLangpackChanged); - CluiLangpackChanged(0, 1); + CluiLangpackChanged(0, 0); + + // make menu bar owner-drawn and set it on + MENUITEMINFO mii; + mii.cbSize = sizeof(mii); + mii.fMask = MIIM_TYPE | MIIM_DATA; + mii.dwItemData = MENU_MIRANDAMENU; + mii.fType = MFT_OWNERDRAW; + SetMenuItemInfo(g_clistApi.hMenuMain, 0, TRUE, &mii); + SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain); + + g_clistApi.pfnOnCreateClc(); PostMessage(g_clistApi.hwndContactList, M_RESTORESTATUS, 0, 0); -- cgit v1.2.3