diff options
Diffstat (limited to 'plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp')
-rw-r--r-- | plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp index 8da3711764..279f6c1206 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp @@ -199,24 +199,20 @@ INT_PTR HideOfflineRootHelper(WPARAM, LPARAM) static int OnBuildGroupMenu(WPARAM, LPARAM)
{
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_FLAGS | (cfg::getByte("CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CMIF_CHECKED : 0);
- Menu_ModifyItem(hHideOfflineUsersMenuItem, &mi);
-
- mi.flags = CMIM_FLAGS | (SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) ? CMIF_CHECKED : 0);
- Menu_ModifyItem(hHideOfflineUsersOutHereMenuItem, &mi);
+ int flags = (cfg::getByte("CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CMIF_CHECKED : 0);
+ Menu_ModifyItem(hHideOfflineUsersMenuItem, NULL, INVALID_HANDLE_VALUE, flags);
- mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS ? CMIF_CHECKED : 0);
- Menu_ModifyItem(hHideEmptyGroupsMenuItem, &mi);
+ flags = (SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) ? CMIF_CHECKED : 0);
+ Menu_ModifyItem(hHideOfflineUsersOutHereMenuItem, NULL, INVALID_HANDLE_VALUE, flags);
- mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS ? 0 : CMIF_CHECKED);
- Menu_ModifyItem(hDisableGroupsMenuItem, &mi);
+ flags = (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS ? CMIF_CHECKED : 0);
+ Menu_ModifyItem(hHideEmptyGroupsMenuItem, NULL, INVALID_HANDLE_VALUE, flags);
- mi.flags = CMIM_FLAGS;
- Menu_ModifyItem(hGroupMainMenuItemProxy, &mi);
+ flags = (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS ? 0 : CMIF_CHECKED);
+ Menu_ModifyItem(hDisableGroupsMenuItem, NULL, INVALID_HANDLE_VALUE, flags);
- mi.flags = CMIM_FLAGS;
- Menu_ModifyItem(hAppearanceMenuItemProxy, &mi);
+ Menu_ModifyItem(hGroupMainMenuItemProxy, NULL, INVALID_HANDLE_VALUE, flags);
+ Menu_ModifyItem(hAppearanceMenuItemProxy, NULL, INVALID_HANDLE_VALUE, flags);
return 0;
}
@@ -368,13 +364,8 @@ typedef struct { static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM)
{
ClcGroup *group = (ClcGroup *)wParam;
- if (group == 0)
- return 0;
-
- //contact->group
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_FLAGS | (group->hideOffline ? CMIF_CHECKED : 0);
- Menu_ModifyItem(hHideOfflineUsersHereMenuItem, &mi);
+ if (group != 0) // contact->group
+ Menu_ModifyItem(hHideOfflineUsersHereMenuItem, NULL, INVALID_HANDLE_VALUE, group->hideOffline ? CMIF_CHECKED : 0);
return 0;
}
|