diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-13 17:32:08 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-13 17:32:08 +0300 |
commit | 520fca8c13037c9077e7d372c0d20a2364964ffb (patch) | |
tree | 9b8594a08387b2e31952e4ece4f92732b50ca38f /plugins/Clist_modern | |
parent | d34d3314d9da310469343a0de2f4b3b49c3a56b9 (diff) |
Contacts lists:
- duplicate IDR_CLISTMENU resources removed, the only copy remains in mir_app.dll;
- local variable g_hMenuMain removed from Clist_Modern and replaced with g_clistApi.hMenuMain;
- duplicate code removed from Clist_Modern (CLUI::CreateCluiFrames())
- fixes #1465 (StdClist: "Status" menu cannot change language on the fly);
- fixes #1467 (Clist_blind: menu cannot change language on the fly);
- fixes menu-related part in #1471
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r-- | plugins/Clist_modern/src/modern_clui.cpp | 26 | ||||
-rw-r--r-- | plugins/Clist_modern/src/resource.h | 1 |
2 files changed, 7 insertions, 20 deletions
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 5abbec1ca8..49c16ff8f0 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -60,7 +60,6 @@ BOOL CALLBACK ProcessCLUIFrameInternalMsg(HWND hwnd, UINT msg, WPARAM wParam, LP UINT g_dwMainThreadID = 0;
HANDLE g_hAwayMsgThread = nullptr, g_hGetTextAsyncThread = nullptr, g_hSmoothAnimationThread = nullptr;
-HMENU g_hMenuMain;
BOOL g_bTransparentFlag = FALSE;
BOOL g_mutex_bChangingMode = FALSE, g_mutex_bSizing = FALSE;
@@ -239,17 +238,6 @@ INT_PTR CLUI::Service_Menu_HideContactAvatar(WPARAM hContact, LPARAM) HRESULT CLUI::CreateCluiFrames()
{
- g_hMenuMain = GetMenu(g_clistApi.hwndContactList);
-
- MENUITEMINFO mii = { 0 };
- mii.cbSize = sizeof(mii);
- mii.fMask = MIIM_SUBMENU;
- mii.hSubMenu = Menu_GetMainMenu();
- SetMenuItemInfo(g_hMenuMain, 0, TRUE, &mii);
-
- mii.hSubMenu = Menu_GetStatusMenu();
- SetMenuItemInfo(g_hMenuMain, 1, TRUE, &mii);
-
CreateCLCWindow(g_clistApi.hwndContactList);
CLUI_ChangeWindowMode();
@@ -688,10 +676,10 @@ void CLUI_ChangeWindowMode() CLUI_UpdateAeroGlass();
- if (g_CluiData.fLayered || !db_get_b(0, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT)) {
+ if (g_CluiData.fLayered || !db_get_b(0, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
SetMenu(g_clistApi.hwndContactList, nullptr);
- }
- else SetMenu(g_clistApi.hwndContactList, g_hMenuMain);
+ else
+ SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain);
if (g_CluiData.fLayered && (db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT)))
ske_UpdateWindowImage();
@@ -2182,7 +2170,7 @@ LRESULT CLUI::OnNcHitTest(UINT, WPARAM wParam, LPARAM lParam) if (result == HTMENU) {
POINT pt = UNPACK_POINT(lParam);
- int t = MenuItemFromPoint(m_hWnd, g_hMenuMain, pt);
+ int t = MenuItemFromPoint(m_hWnd, g_clistApi.hMenuMain, pt);
if (t == -1 && (db_get_b(0, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)))
return HTCAPTION;
}
@@ -2520,9 +2508,9 @@ LRESULT CLUI::OnDestroy(UINT, WPARAM, LPARAM) UnLoadContactListModule();
ClcUnloadModule();
- RemoveMenu(g_hMenuMain, 0, MF_BYPOSITION);
- RemoveMenu(g_hMenuMain, 0, MF_BYPOSITION);
- DestroyMenu(g_hMenuMain);
+ RemoveMenu(g_clistApi.hMenuMain, 0, MF_BYPOSITION);
+ RemoveMenu(g_clistApi.hMenuMain, 0, MF_BYPOSITION);
+ DestroyMenu(g_clistApi.hMenuMain);
Clist_TrayIconDestroy(m_hWnd);
mutex_bAnimationInProgress = 0;
diff --git a/plugins/Clist_modern/src/resource.h b/plugins/Clist_modern/src/resource.h index cb794ad7e3..e2aa094406 100644 --- a/plugins/Clist_modern/src/resource.h +++ b/plugins/Clist_modern/src/resource.h @@ -19,7 +19,6 @@ #define IDI_DELETE 175
#define IDC_DROP 183
#define IDI_SENDEMAIL 193
-#define IDR_CLISTMENU 199
#define IDI_BLANK 200
#define IDD_OPT_ICONS 207
#define IDI_FILE 207
|