diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-14 22:37:33 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-14 22:37:33 +0300 |
commit | a32f58e73573f87c820784287b63cac76b42ae06 (patch) | |
tree | 0acccc8a001c6645823c0d4e1d209b740a04058e /src/mir_app | |
parent | 2782bdaa1009312bdf56fbaabb758b76f1dc23a8 (diff) |
in fact we need to do that only once, not during langpack reset
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/clui.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
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);
|