diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-22 20:38:56 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-22 20:38:56 +0000 |
commit | 88790eed4ffd9ca555c8f9b73cb014a93b57a34f (patch) | |
tree | b3e5bfe096005a9cac4bc14fdfbe5f6f5acad98a /plugins/YAPP | |
parent | 9ecc2aa50e2183e2c4a11861ca6dede7d2151139 (diff) |
Menu_ModifyItem unbound from CLISTMENUITEM structure
git-svn-id: http://svn.miranda-ng.org/main/trunk@14334 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/YAPP')
-rw-r--r-- | plugins/YAPP/src/services.cpp | 16 | ||||
-rw-r--r-- | plugins/YAPP/src/yapp.cpp | 17 |
2 files changed, 8 insertions, 25 deletions
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp index 4132c98e32..c314328c05 100644 --- a/plugins/YAPP/src/services.cpp +++ b/plugins/YAPP/src/services.cpp @@ -195,14 +195,14 @@ void UpdateMenu() {
bool isEnabled = db_get_b(0, "Popup", "ModuleIsEnabled", 1) == 1;
- CLISTMENUITEM mi = { 0 };
- mi.ptszName = (isEnabled ? LPGENT("Disable Popups") : LPGENT("Enable Popups"));
- mi.hIcon = IcoLib_GetIcon(isEnabled ? ICO_POPUP_ON : ICO_POPUP_OFF, 0);
- mi.flags = CMIM_NAME | CMIM_ICON | CMIF_TCHAR;
- Menu_ModifyItem(hMenuItem, &mi);
-
- mi.flags = CMIM_ICON;
- Menu_ModifyItem(hMenuRoot, &mi);
+ if (isEnabled) {
+ Menu_ModifyItem(hMenuItem, LPGENT("Disable Popups"), IcoLib_GetIcon(ICO_POPUP_ON));
+ Menu_ModifyItem(hMenuRoot, NULL, IcoLib_GetIcon(ICO_POPUP_ON));
+ }
+ else {
+ Menu_ModifyItem(hMenuItem, LPGENT("Enable Popups"), IcoLib_GetIcon(ICO_POPUP_OFF));
+ Menu_ModifyItem(hMenuRoot, NULL, IcoLib_GetIcon(ICO_POPUP_OFF));
+ }
if (hTTButton)
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTButton, isEnabled ? TTBST_PUSHED : 0);
diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp index f5dcbf2ed2..bb2c0065f8 100644 --- a/plugins/YAPP/src/yapp.cpp +++ b/plugins/YAPP/src/yapp.cpp @@ -71,22 +71,6 @@ int ReloadFont(WPARAM wParam, LPARAM lParam) return 0;
}
-int IconsChanged(WPARAM, LPARAM)
-{
- CLISTMENUITEM mi = { 0 };
-
- mi.hIcon = IcoLib_GetIcon(db_get_b(0, "Popup", "ModuleIsEnabled", 1) ? ICO_POPUP_ON : ICO_POPUP_OFF, 0);
- mi.flags = CMIM_ICON;
- Menu_ModifyItem(hMenuItem, &mi);
- Menu_ModifyItem(hMenuRoot, &mi);
-
- mi.hIcon = IcoLib_GetIcon(ICO_HISTORY, 0);
- mi.flags = CMIM_ICON;
- Menu_ModifyItem(hMenuItemHistory, &mi);
-
- return 0;
-}
-
int TTBLoaded(WPARAM, LPARAM)
{
TTBButton ttb = { sizeof(ttb) };
@@ -243,7 +227,6 @@ extern "C" int __declspec(dllexport) Load(void) InitIcons();
InitMenuItems();
- HookEvent(ME_SKIN2_ICONSCHANGED, IconsChanged);
HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
return 0;
|