diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/clist/clistmenus.cpp | 1 | ||||
-rw-r--r-- | src/modules/clist/clui.cpp | 1 | ||||
-rw-r--r-- | src/modules/clist/genmenu.cpp | 23 | ||||
-rw-r--r-- | src/modules/clist/movetogroup.cpp | 2 | ||||
-rw-r--r-- | src/modules/findadd/findadd.cpp | 1 | ||||
-rw-r--r-- | src/modules/icolib/skin2icons.cpp | 30 | ||||
-rw-r--r-- | src/modules/options/options.cpp | 1 | ||||
-rw-r--r-- | src/modules/protocols/protoopts.cpp | 1 |
8 files changed, 23 insertions, 37 deletions
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp index debabd55a2..4222f2d6ed 100644 --- a/src/modules/clist/clistmenus.cpp +++ b/src/modules/clist/clistmenus.cpp @@ -1391,7 +1391,6 @@ void InitCustomMenus(void) CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 0x7fffffff;
- mi.flags = CMIF_ICONFROMICOLIB;
mi.pszService = "CloseAction";
mi.pszName = LPGEN("E&xit");
mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_EXIT);
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index f99841a069..7b6e5f7db0 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -349,7 +349,6 @@ int LoadCLUIModule(void) 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIF_ICONFROMICOLIB;
CreateServiceFunction("CList/DeleteContactCommand", MenuItem_DeleteContact);
mi.position = 2000070000;
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index b7df40afcb..47909e8d1b 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -316,15 +316,16 @@ int MO_ModifyMenuItem(PMO_IntMenuItem menuHandle, PMO_MenuItem pmi) }
if (pmi->flags & CMIM_FLAGS) {
- oldflags = pimi->mi.flags & (CMIF_ROOTHANDLE | CMIF_ICONFROMICOLIB);
+ oldflags = (pimi->mi.flags & CMIF_ROOTHANDLE);
pimi->mi.flags = (pmi->flags & ~CMIM_ALL) | oldflags;
}
if ((pmi->flags & CMIM_ICON) && !bIconsDisabled) {
- if (pimi->mi.flags & CMIF_ICONFROMICOLIB) {
- HICON hIcon = IcoLib_GetIconByHandle(pmi->hIcolibItem, false);
+ HANDLE hIcolibItem = IcoLib_IsManaged(pmi->hIcon);
+ if (hIcolibItem) {
+ HICON hIcon = IcoLib_GetIconByHandle(hIcolibItem, false);
if (hIcon != NULL) {
- pimi->hIcolibItem = pmi->hIcolibItem;
+ pimi->hIcolibItem = hIcolibItem;
pimi->iconId = ImageList_ReplaceIcon(pimi->parent->m_hMenuIcons, pimi->iconId, hIcon);
IcoLib_ReleaseIcon(hIcon, 0);
}
@@ -648,20 +649,14 @@ PMO_IntMenuItem MO_AddNewMenuItem(HANDLE menuobjecthandle, PMO_MenuItem pmi) p->mi.ptszName = mir_a2u(pmi->pszName);
if (pmi->hIcon != NULL && !bIconsDisabled) {
- if (pmi->flags & CMIF_ICONFROMICOLIB) {
- HICON hIcon = IcoLib_GetIconByHandle(pmi->hIcolibItem, false);
+ HANDLE hIcolibItem = IcoLib_IsManaged(pmi->hIcon);
+ if (hIcolibItem != NULL) {
+ HICON hIcon = IcoLib_GetIconByHandle(hIcolibItem, false);
p->iconId = ImageList_AddIcon(pmo->m_hMenuIcons, hIcon);
p->hIcolibItem = pmi->hIcolibItem;
IcoLib_ReleaseIcon(hIcon, 0);
}
- else {
- HANDLE hIcolibItem = IcoLib_IsManaged(pmi->hIcon);
- if (hIcolibItem) {
- p->iconId = ImageList_AddIcon(pmo->m_hMenuIcons, pmi->hIcon);
- p->hIcolibItem = hIcolibItem;
- }
- else p->iconId = ImageList_AddIcon(pmo->m_hMenuIcons, pmi->hIcon);
- }
+ else p->iconId = ImageList_AddIcon(pmo->m_hMenuIcons, pmi->hIcon);
}
if (p->mi.root == HGENMENU_ROOT)
diff --git a/src/modules/clist/movetogroup.cpp b/src/modules/clist/movetogroup.cpp index b661c90c55..5877bb9949 100644 --- a/src/modules/clist/movetogroup.cpp +++ b/src/modules/clist/movetogroup.cpp @@ -90,7 +90,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 100000;
mi.pszName = LPGEN("&Move to Group");
- mi.flags = CMIF_ROOTHANDLE | CMIF_ICONFROMICOLIB;
+ mi.flags = CMIF_ROOTHANDLE;
mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_GROUP);
hMoveToGroupItem = Menu_AddContactMenuItem(&mi);
diff --git a/src/modules/findadd/findadd.cpp b/src/modules/findadd/findadd.cpp index 91a53c8ffd..9bbc8ddcff 100644 --- a/src/modules/findadd/findadd.cpp +++ b/src/modules/findadd/findadd.cpp @@ -1026,7 +1026,6 @@ int LoadFindAddModule(void) CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 500020000;
- mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_FINDUSER);
mi.pszName = LPGEN("&Find/Add Contacts...");
mi.pszService = MS_FINDADD_FINDADD;
diff --git a/src/modules/icolib/skin2icons.cpp b/src/modules/icolib/skin2icons.cpp index f5e7484df2..46f60374fd 100644 --- a/src/modules/icolib/skin2icons.cpp +++ b/src/modules/icolib/skin2icons.cpp @@ -449,12 +449,8 @@ static void IcoLib_RemoveSection(SectionItem* section) IcolibItem* IcoLib_FindIcon(const char* pszIconName)
{
- int indx;
- IcolibItem key = { (char*)pszIconName };
- if ((indx = iconList.getIndex(&key)) != -1)
- return iconList[ indx ];
-
- return NULL;
+ int indx = iconList.getIndex((IcolibItem*)&pszIconName);
+ return (indx != -1) ? iconList[ indx ] : 0;
}
IcolibItem* IcoLib_FindHIcon(HICON hIcon, bool &big)
@@ -465,7 +461,7 @@ IcolibItem* IcoLib_FindHIcon(HICON hIcon, bool &big) big = (p->source_small == NULL);
return p;
}
- if (p->source_small && p->source_small->icon == hIcon) {
+ if (p->source_small && p->source_small->icon == hIcon) {
big = false;
return p;
}
@@ -838,18 +834,18 @@ int LoadIcoLibModule(void) hIconBlank = LoadIconEx(NULL, MAKEINTRESOURCE(IDI_BLANK), 0);
InitializeCriticalSection(&csIconList);
- hIcoLib_AddNewIcon = CreateServiceFunction("Skin2/Icons/AddIcon", sttIcoLib_AddNewIcon);
- hIcoLib_RemoveIcon = CreateServiceFunction(MS_SKIN2_REMOVEICON, IcoLib_RemoveIcon);
- hIcoLib_GetIcon = CreateServiceFunction(MS_SKIN2_GETICON, sttIcoLib_GetIcon);
- hIcoLib_GetIconHandle = CreateServiceFunction(MS_SKIN2_GETICONHANDLE, sttIcoLib_GetIconHandle);
- hIcoLib_GetIcon2 = CreateServiceFunction(MS_SKIN2_GETICONBYHANDLE, sttIcoLib_GetIconByHandle);
- hIcoLib_IsManaged = CreateServiceFunction(MS_SKIN2_ISMANAGEDICON, sttIcoLib_IsManaged);
- hIcoLib_AddRef = CreateServiceFunction(MS_SKIN2_ADDREFICON, IcoLib_AddRef);
- hIcoLib_ReleaseIcon = CreateServiceFunction(MS_SKIN2_RELEASEICON, sttIcoLib_ReleaseIcon);
- hIcoLib_ReleaseIcon = CreateServiceFunction(MS_SKIN2_RELEASEICONBIG, sttIcoLib_ReleaseIconBig);
+ hIcoLib_AddNewIcon = CreateServiceFunction("Skin2/Icons/AddIcon", sttIcoLib_AddNewIcon);
+ hIcoLib_RemoveIcon = CreateServiceFunction(MS_SKIN2_REMOVEICON, IcoLib_RemoveIcon);
+ hIcoLib_GetIcon = CreateServiceFunction(MS_SKIN2_GETICON, sttIcoLib_GetIcon);
+ hIcoLib_GetIconHandle = CreateServiceFunction(MS_SKIN2_GETICONHANDLE, sttIcoLib_GetIconHandle);
+ hIcoLib_GetIcon2 = CreateServiceFunction(MS_SKIN2_GETICONBYHANDLE, sttIcoLib_GetIconByHandle);
+ hIcoLib_IsManaged = CreateServiceFunction(MS_SKIN2_ISMANAGEDICON, sttIcoLib_IsManaged);
+ hIcoLib_AddRef = CreateServiceFunction(MS_SKIN2_ADDREFICON, IcoLib_AddRef);
+ hIcoLib_ReleaseIcon = CreateServiceFunction(MS_SKIN2_RELEASEICON, sttIcoLib_ReleaseIcon);
+ hIcoLib_ReleaseIcon = CreateServiceFunction(MS_SKIN2_RELEASEICONBIG, sttIcoLib_ReleaseIconBig);
hIcons2ChangedEvent = CreateHookableEvent(ME_SKIN2_ICONSCHANGED);
- hIconsChangedEvent = CreateHookableEvent(ME_SKIN_ICONSCHANGED);
+ hIconsChangedEvent = CreateHookableEvent(ME_SKIN_ICONSCHANGED);
HookEvent(ME_SYSTEM_MODULESLOADED, SkinSystemModulesLoaded);
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index 881258106e..9b0c4e0e11 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -1390,7 +1390,6 @@ static INT_PTR AddOptionsPage(WPARAM wParam, LPARAM lParam) static int OptModulesLoaded(WPARAM, LPARAM)
{
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_OPTIONS);
mi.position = 1900000000;
mi.pszName = LPGEN("&Options...");
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp index 90e9ac6df6..3e03433e15 100644 --- a/src/modules/protocols/protoopts.cpp +++ b/src/modules/protocols/protoopts.cpp @@ -1043,7 +1043,6 @@ static INT_PTR OptProtosShow(WPARAM, LPARAM) int OptProtosLoaded(WPARAM, LPARAM)
{
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_ACCMGR);
mi.position = 1900000000;
mi.pszName = LPGEN("&Accounts...");
|