diff options
Diffstat (limited to 'plugins/YAPP/src')
-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;
|