diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-09 16:28:38 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-09 16:28:38 +0000 |
commit | f24df8d7c43d0bd1e4f8036a1f9d886ccdc3680c (patch) | |
tree | 5c64d24932839487d9e836491f9ca32ab7bd2ddc /plugins | |
parent | ddd6c8f83ee10e7312458985c4ff624e68abf75b (diff) |
part II:
- extra icons masks killed from the nicer+ cache;
- some minor glitches in options
git-svn-id: http://svn.miranda-ng.org/main/trunk@2261 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Clist_nicer/src/Include/clc.h | 3 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcitems.cpp | 18 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcopts.cpp | 128 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcpaint.cpp | 9 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcutils.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clistmenus.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/config.cpp | 1 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/init.cpp | 1 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/statusfloater.cpp | 438 |
9 files changed, 281 insertions, 331 deletions
diff --git a/plugins/Clist_nicer/src/Include/clc.h b/plugins/Clist_nicer/src/Include/clc.h index ea9e93f65f..1936dfcd3b 100644 --- a/plugins/Clist_nicer/src/Include/clc.h +++ b/plugins/Clist_nicer/src/Include/clc.h @@ -130,7 +130,6 @@ struct TExtraCache BYTE bStatusMsgValid;
DWORD dwCFlags;
DWORD dwDFlags; // display flags for caching only
- DWORD dwXMask; // local extra icon mask, calculated from CLN_xmask
StatusItems_t *status_item, *proto_status_item;
CONTACTFLOATER *floater;
DWORD dwLastMsgTime;
@@ -277,7 +276,6 @@ struct TCluiData { BYTE autosize;
BYTE gapBetweenFrames;
BYTE titleBarHeight;
- DWORD dwExtraImageMask;
BYTE bClipBorder, bRowSpacing;
HBITMAP bmpBackground, hbmBgOld, hbmBg;
HDC hdcBg;
@@ -442,7 +440,6 @@ int GetExtraCache(HANDLE hContact, char *szProto); void ReloadExtraInfo(HANDLE hContact);
void LoadAvatarForContact(ClcContact *p);
void ApplyViewMode(const char *name);
-DWORD CalcXMask(HANDLE hContact);
void ClcSetButtonState(int ctrlId, int status);
HWND ClcGetButtonWindow(int ctrlid);
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index daa2c859f0..4d3741a06d 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -508,24 +508,6 @@ void ReloadSkinItemsToCache() }
}
-DWORD CalcXMask(HANDLE hContact)
-{
- DWORD dwXMask = cfg::getDword(hContact, "CList", "CLN_xmask", 0);
- DWORD dwResult = cfg::dat.dwExtraImageMask, bForced, bHidden;
-
- for (int i = 0; i <= 10; i++) {
- bForced = (dwXMask & (1 << (2 * i)));
- bHidden = (dwXMask & (1 << (2 * i + 1)));
- if (bForced == 0 && bHidden == 0)
- continue;
- else if (bForced)
- dwResult |= (1 << i);
- else if (bHidden)
- dwResult &= ~(1 << i);
- }
- return(dwResult);
-}
-
/*
* checks the currently active view mode filter and returns true, if the contact should be hidden
* if no view mode is active, it returns the CList/Hidden setting
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 9d061d0171..7d0f126399 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -343,20 +343,19 @@ static INT_PTR CALLBACK DlgProcDspAdvanced(HWND hwndDlg, UINT msg, WPARAM wParam {
switch (msg) {
case WM_INITDIALOG:
- {
- int i = 0;
-
- TranslateDialogDefault(hwndDlg);
- SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Never"));
- SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always"));
- SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("When space allows it"));
- SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("When needed"));
+ TranslateDialogDefault(hwndDlg);
- SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_INSERTSTRING, -1, (LPARAM)TranslateT("With Nickname - left"));
- SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Far left"));
- SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Far right"));
- SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_INSERTSTRING, -1, (LPARAM)TranslateT("With Nickname - right"));
+ SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Never"));
+ SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always"));
+ SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("When space allows it"));
+ SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("When needed"));
+ SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_INSERTSTRING, -1, (LPARAM)TranslateT("With Nickname - left"));
+ SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Far left"));
+ SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Far right"));
+ SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_INSERTSTRING, -1, (LPARAM)TranslateT("With Nickname - right"));
+ {
+ int i = 0;
if (cfg::dat.bAvatarServiceAvail) {
Utils::enableDlgControl(hwndDlg, IDC_CLISTAVATARS, TRUE);
while(avatar_controls[i] != 0)
@@ -367,41 +366,41 @@ static INT_PTR CALLBACK DlgProcDspAdvanced(HWND hwndDlg, UINT msg, WPARAM wParam while(avatar_controls[i] != 0)
Utils::enableDlgControl(hwndDlg, avatar_controls[i++], FALSE);
}
+ }
- CheckDlgButton(hwndDlg, IDC_NOAVATARSOFFLINE, cfg::dat.bNoOfflineAvatars);
- SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_SETCURSEL, cfg::dat.dualRowMode, 0);
- CheckDlgButton(hwndDlg, IDC_CLISTAVATARS, (cfg::dat.dwFlags & CLUI_FRAME_AVATARS) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOAVATARSOFFLINE, cfg::dat.bNoOfflineAvatars);
+ SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_SETCURSEL, cfg::dat.dualRowMode, 0);
+ CheckDlgButton(hwndDlg, IDC_CLISTAVATARS, (cfg::dat.dwFlags & CLUI_FRAME_AVATARS) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AVATARSBORDER, (cfg::dat.dwFlags & CLUI_FRAME_AVATARBORDER) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AVATARSROUNDED, (cfg::dat.dwFlags & CLUI_FRAME_ROUNDAVATAR) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ALWAYSALIGNNICK, (cfg::dat.dwFlags & CLUI_FRAME_ALWAYSALIGNNICK) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWSTATUSMSG, (cfg::dat.dwFlags & CLUI_FRAME_SHOWSTATUSMSG) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AVATARSBORDER, (cfg::dat.dwFlags & CLUI_FRAME_AVATARBORDER) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AVATARSROUNDED, (cfg::dat.dwFlags & CLUI_FRAME_ROUNDAVATAR) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALWAYSALIGNNICK, (cfg::dat.dwFlags & CLUI_FRAME_ALWAYSALIGNNICK) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWSTATUSMSG, (cfg::dat.dwFlags & CLUI_FRAME_SHOWSTATUSMSG) ? BST_CHECKED : BST_UNCHECKED);
- SendDlgItemMessage(hwndDlg, IDC_AVATARBORDERCLR, CPM_SETCOLOUR, 0, cfg::dat.avatarBorder);
+ SendDlgItemMessage(hwndDlg, IDC_AVATARBORDERCLR, CPM_SETCOLOUR, 0, cfg::dat.avatarBorder);
- SendDlgItemMessage(hwndDlg, IDC_RADIUSSPIN, UDM_SETRANGE, 0, MAKELONG(10, 2));
- SendDlgItemMessage(hwndDlg, IDC_RADIUSSPIN, UDM_SETPOS, 0, cfg::dat.avatarRadius);
+ SendDlgItemMessage(hwndDlg, IDC_RADIUSSPIN, UDM_SETRANGE, 0, MAKELONG(10, 2));
+ SendDlgItemMessage(hwndDlg, IDC_RADIUSSPIN, UDM_SETPOS, 0, cfg::dat.avatarRadius);
- SendDlgItemMessage(hwndDlg, IDC_AVATARSIZESPIN, UDM_SETRANGE, 0, MAKELONG(100, 16));
- SendDlgItemMessage(hwndDlg, IDC_AVATARSIZESPIN, UDM_SETPOS, 0, cfg::dat.avatarSize);
+ SendDlgItemMessage(hwndDlg, IDC_AVATARSIZESPIN, UDM_SETRANGE, 0, MAKELONG(100, 16));
+ SendDlgItemMessage(hwndDlg, IDC_AVATARSIZESPIN, UDM_SETPOS, 0, cfg::dat.avatarSize);
- Utils::enableDlgControl(hwndDlg, IDC_RADIUS, IsDlgButtonChecked(hwndDlg, IDC_AVATARSROUNDED) ? TRUE : FALSE);
- Utils::enableDlgControl(hwndDlg, IDC_RADIUSSPIN, IsDlgButtonChecked(hwndDlg, IDC_AVATARSROUNDED) ? TRUE : FALSE);
- Utils::enableDlgControl(hwndDlg, IDC_AVATARBORDERCLR, IsDlgButtonChecked(hwndDlg, IDC_AVATARSBORDER) ? TRUE : FALSE);
+ Utils::enableDlgControl(hwndDlg, IDC_RADIUS, IsDlgButtonChecked(hwndDlg, IDC_AVATARSROUNDED) ? TRUE : FALSE);
+ Utils::enableDlgControl(hwndDlg, IDC_RADIUSSPIN, IsDlgButtonChecked(hwndDlg, IDC_AVATARSROUNDED) ? TRUE : FALSE);
+ Utils::enableDlgControl(hwndDlg, IDC_AVATARBORDERCLR, IsDlgButtonChecked(hwndDlg, IDC_AVATARSBORDER) ? TRUE : FALSE);
- CheckDlgButton(hwndDlg, IDC_SHOWLOCALTIME, cfg::dat.bShowLocalTime ? 1 : 0);
- CheckDlgButton(hwndDlg, IDC_SHOWLOCALTIMEONLYWHENDIFFERENT, cfg::dat.bShowLocalTimeSelective ? 1 : 0);
- Utils::enableDlgControl(hwndDlg, IDC_SHOWLOCALTIMEONLYWHENDIFFERENT, IsDlgButtonChecked(hwndDlg, IDC_SHOWLOCALTIME));
+ CheckDlgButton(hwndDlg, IDC_SHOWLOCALTIME, cfg::dat.bShowLocalTime ? 1 : 0);
+ CheckDlgButton(hwndDlg, IDC_SHOWLOCALTIMEONLYWHENDIFFERENT, cfg::dat.bShowLocalTimeSelective ? 1 : 0);
+ Utils::enableDlgControl(hwndDlg, IDC_SHOWLOCALTIMEONLYWHENDIFFERENT, IsDlgButtonChecked(hwndDlg, IDC_SHOWLOCALTIME));
- if (cfg::dat.dwFlags & CLUI_FRAME_AVATARSLEFT)
- SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_SETCURSEL, 1, 0);
- else if (cfg::dat.dwFlags & CLUI_FRAME_AVATARSRIGHT)
- SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_SETCURSEL, 2, 0);
- else if (cfg::dat.dwFlags & CLUI_FRAME_AVATARSRIGHTWITHNICK)
- SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_SETCURSEL, 3, 0);
- else
- SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_SETCURSEL, 0, 0);
- }
+ if (cfg::dat.dwFlags & CLUI_FRAME_AVATARSLEFT)
+ SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_SETCURSEL, 1, 0);
+ else if (cfg::dat.dwFlags & CLUI_FRAME_AVATARSRIGHT)
+ SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_SETCURSEL, 2, 0);
+ else if (cfg::dat.dwFlags & CLUI_FRAME_AVATARSRIGHTWITHNICK)
+ SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_SETCURSEL, 3, 0);
+ else
+ SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_SETCURSEL, 0, 0);
return TRUE;
case WM_COMMAND:
@@ -434,7 +433,7 @@ static INT_PTR CALLBACK DlgProcDspAdvanced(HWND hwndDlg, UINT msg, WPARAM wParam LRESULT sel = SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_GETCURSEL, 0, 0);
DWORD flags = 0;
if (sel != CB_ERR) {
- cfg::dat.dwFlags &= (CLUI_FRAME_AVATARSLEFT | CLUI_FRAME_AVATARSRIGHT | CLUI_FRAME_AVATARSRIGHTWITHNICK);
+ cfg::dat.dwFlags &= ~(CLUI_FRAME_AVATARSLEFT | CLUI_FRAME_AVATARSRIGHT | CLUI_FRAME_AVATARSRIGHTWITHNICK);
if (sel == 1)
cfg::dat.dwFlags |= CLUI_FRAME_AVATARSLEFT;
else if (sel == 2)
@@ -567,6 +566,7 @@ int ClcOptInit(WPARAM wParam, LPARAM lParam) ////////////////////////////////////////////////////////////////////////////
// Contact rows tabs
+ odp.position = 0;
odp.pszGroup = LPGEN("Contact List");
odp.pszTitle = LPGEN("Contact rows");
odp.pszTab = LPGEN("Contacts");
@@ -635,12 +635,13 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam Utils::enableDlgControl(hwndDlg, IDC_GREYOUTOPTS, IsDlgButtonChecked(hwndDlg, IDC_GREYOUT));
FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), greyoutValues, sizeof(greyoutValues) / sizeof(greyoutValues[0]), cfg::getDword("CLC", "FullGreyoutFlags", CLCDEFAULT_FULLGREYOUTFLAGS));
CheckDlgButton(hwndDlg, IDC_NOSCROLLBAR, cfg::getByte("CLC", "NoVScrollBar", 0) ? BST_CHECKED : BST_UNCHECKED);
-
return TRUE;
+
case WM_VSCROLL:
opt_clc_main_changed = 1;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
+
case WM_COMMAND:
if (LOWORD(wParam) == IDC_NOTNOSMOOTHSCROLLING)
Utils::enableDlgControl(hwndDlg, IDC_SMOOTHTIME, IsDlgButtonChecked(hwndDlg, IDC_NOTNOSMOOTHSCROLLING));
@@ -649,6 +650,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
opt_clc_main_changed = 1;
break;
+
case WM_NOTIFY:
switch (((LPNMHDR) lParam)->idFrom) {
case IDC_GREYOUTOPTS:
@@ -670,33 +672,31 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam }
}
break;
+
case 0:
- switch (((LPNMHDR) lParam)->code) {
- case PSN_APPLY:
- {
- int i;
- DWORD exStyle = cfg::getDword("CLC", "ExStyle", CLCDEFAULT_EXSTYLE);
+ if (((LPNMHDR) lParam)->code == PSN_APPLY) {
+ if (!opt_clc_main_changed)
+ return TRUE;
- if (!opt_clc_main_changed)
- return TRUE;
+ int i;
+ DWORD exStyle = cfg::getDword("CLC", "ExStyle", CLCDEFAULT_EXSTYLE);
- for (i = 0; i < sizeof(checkBoxToStyleEx) / sizeof(checkBoxToStyleEx[0]); i++)
- exStyle &= ~(checkBoxToStyleEx[i].flag);
+ for (i = 0; i < sizeof(checkBoxToStyleEx) / sizeof(checkBoxToStyleEx[0]); i++)
+ exStyle &= ~(checkBoxToStyleEx[i].flag);
- for (i = 0; i < sizeof(checkBoxToStyleEx) / sizeof(checkBoxToStyleEx[0]); i++) {
- if ((IsDlgButtonChecked(hwndDlg, checkBoxToStyleEx[i].id) == 0) == checkBoxToStyleEx[i].not_t)
- exStyle |= checkBoxToStyleEx[i].flag;
- }
- cfg::writeDword("CLC", "ExStyle", exStyle);
- } {
- DWORD fullGreyoutFlags = MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS));
- cfg::writeDword("CLC", "FullGreyoutFlags", fullGreyoutFlags);
- if (IsDlgButtonChecked(hwndDlg, IDC_GREYOUT))
- cfg::writeDword("CLC", "GreyoutFlags", fullGreyoutFlags);
- else
- cfg::writeDword("CLC", "GreyoutFlags", 0);
+ for (i = 0; i < sizeof(checkBoxToStyleEx) / sizeof(checkBoxToStyleEx[0]); i++) {
+ if ((IsDlgButtonChecked(hwndDlg, checkBoxToStyleEx[i].id) == 0) == checkBoxToStyleEx[i].not_t)
+ exStyle |= checkBoxToStyleEx[i].flag;
}
-
+ cfg::writeDword("CLC", "ExStyle", exStyle);
+
+ DWORD fullGreyoutFlags = MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS));
+ cfg::writeDword("CLC", "FullGreyoutFlags", fullGreyoutFlags);
+ if (IsDlgButtonChecked(hwndDlg, IDC_GREYOUT))
+ cfg::writeDword("CLC", "GreyoutFlags", fullGreyoutFlags);
+ else
+ cfg::writeDword("CLC", "GreyoutFlags", 0);
+
cfgSetFlag(hwndDlg, IDC_FULLROWSELECT, CLUI_FULLROWSELECT);
cfg::writeWord("CLC", "ScrollTime", (WORD) SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0));
@@ -710,9 +710,9 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam opt_clc_main_changed = 0;
return TRUE;
}
- break;
}
break;
+
case WM_DESTROY:
ImageList_Destroy(TreeView_GetImageList(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), TVSIL_STATE));
break;
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp index 15edd69be8..9ddd2f3f05 100644 --- a/plugins/Clist_nicer/src/clcpaint.cpp +++ b/plugins/Clist_nicer/src/clcpaint.cpp @@ -971,12 +971,8 @@ bgskipped: BYTE bApparentModeDontCare = !((flags & CONTACTF_VISTO) ^ (flags & CONTACTF_INVISTO));
contact->extraIconRightBegin = 0;
if (cEntry && (contact->extraCacheEntry >= 0 && contact->extraCacheEntry < cfg::nextCacheEntry)) {
- DWORD dwOldMask = cEntry->dwXMask;
-//!!!!!! if (dwFlags & CLUI_FRAME_USEXSTATUSASSTATUS)
-//!!!!!! cEntry->dwXMask &= ~EIMG_SHOW_ADV1;
-
for (int i = EXTRA_ICON_COUNT - 1; i >= 0; i--) {
- if (contact->iExtraImage[i] != 0xffff && ((1 << i) & cEntry->dwXMask)) {
+ if (contact->iExtraImage[i] != EMPTY_EXTRA_ICON) {
if (contact->extraIconRightBegin == 0 && i != (EXTRA_ICON_COUNT - 1))
contact->extraIconRightBegin = rcContent.right;
ImageList_DrawEx(dat->himlExtraColumns, contact->iExtraImage[i], hdcMem, rcContent.right - cfg::dat.exIconScale, twoRows ? rcContent.bottom - g_exIconSpacing : y + ((rowHeight - cfg::dat.exIconScale) >> 1),
@@ -985,7 +981,6 @@ bgskipped: rightIcons++;
}
}
- cEntry->dwXMask = dwOldMask;
}
if (!bApparentModeDontCare && (dwFlags & CLUI_SHOWVISI) && contact->proto) {
BOOL fVisi;
@@ -1093,7 +1088,7 @@ text: if (!g_center) {
rc.top = y + ((rowHeight) >> 1); rc.bottom = rc.top + 2;
rc.left = rightLineStart;
- rc.right = clRect->right - 1 - dat->extraColumnSpacing * dat->extraColumnsCount - dat->rightMargin;
+ rc.right = clRect->right - 1 - dat->rightMargin;
if (rc.right - rc.left > 1)
DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT);
}
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index 79a7eda987..98a7f81fe2 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -145,8 +145,7 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact for (i = EXTRA_ICON_COUNT-1; i >= 0; i--) {
if (hitcontact->iExtraImage[i] == EMPTY_EXTRA_ICON)
continue;
- if (!((1 << i) & cfg::eCache[hitcontact->extraCacheEntry].dwXMask))
- continue;
+
images_present++;
if (testx < right - (rightOffset - (cfg::dat.exIconScale + 2) * images_present) && testx > right - (rightOffset - (cfg::dat.exIconScale + 2) * images_present + (cfg::dat.exIconScale))) {
if (flags)
@@ -301,8 +300,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c for (i = EXTRA_ICON_COUNT; i >= 0; i--) {
if (hitcontact->iExtraImage[i] == EMPTY_EXTRA_ICON)
continue;
- if (!((1 << i) & cfg::eCache[hitcontact->extraCacheEntry].dwXMask))
- continue;
+
images_present++;
if (testx > (rightOffset - (cfg::dat.exIconScale + 2) * images_present) && testx < (rightOffset - (cfg::dat.exIconScale + 2) * images_present + (cfg::dat.exIconScale))) {
if (flags)
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index 2078fcc6ed..9dd464115a 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -278,17 +278,13 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA }
cfg::writeDword(hContact, "CList", "CLN_xmask", dwXMask);
if (contact) {
- if (contact->extraCacheEntry >= 0 && contact->extraCacheEntry <= cfg::nextCacheEntry) {
+ if (contact->extraCacheEntry >= 0 && contact->extraCacheEntry <= cfg::nextCacheEntry)
cfg::eCache[contact->extraCacheEntry].dwDFlags = dwFlags;
- cfg::eCache[contact->extraCacheEntry].dwXMask = CalcXMask(hContact);
- }
}
else {
int iIndex = cfg::getCache(hContact, NULL);
- if (iIndex >= 0 && iIndex <= cfg::nextCacheEntry) {
+ if (iIndex >= 0 && iIndex <= cfg::nextCacheEntry)
cfg::eCache[iIndex].dwDFlags = dwFlags;
- cfg::eCache[iIndex].dwXMask = CalcXMask(hContact);
- }
}
cfg::writeByte(hContact, "CList", "Priority", (BYTE)(IsDlgButtonChecked(hWnd, IDC_IGN_PRIORITY) ? 1 : 0));
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp index 676c145c9e..ab2d046b52 100644 --- a/plugins/Clist_nicer/src/config.cpp +++ b/plugins/Clist_nicer/src/config.cpp @@ -227,7 +227,6 @@ int cfg::getCache(const HANDLE hContact, const char *szProto) LoadSkinItemToCache(&cfg::eCache[nextCacheEntry], szProto);
cfg::eCache[nextCacheEntry].dwCFlags = 0;
cfg::eCache[nextCacheEntry].dwDFlags = DBGetContactSettingDword(hContact, "CList", "CLN_Flags", 0);
- cfg::eCache[nextCacheEntry].dwXMask = CalcXMask(hContact);
GetCachedStatusMsg(nextCacheEntry, const_cast<char *>(szProto));
cfg::eCache[nextCacheEntry].dwLastMsgTime = INTSORT_GetLastMsgTime(hContact);
iFound = nextCacheEntry++;
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index 1e04a64799..455ca38bfb 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -246,7 +246,6 @@ extern "C" int __declspec(dllexport) CListInitialise() cfg::dat.autoalpha = cfg::getByte("CList", "AutoAlpha", SETTING_ALPHA_DEFAULT);
cfg::dat.fadeinout = cfg::getByte("CLUI", "FadeInOut", 0);
cfg::dat.autosize = cfg::getByte("CLUI", "AutoSize", 0);
- cfg::dat.dwExtraImageMask = cfg::getDword("CLUI", "ximgmask", 0);
cfg::dat.bNoOfflineAvatars = cfg::getByte("CList", "NoOfflineAV", 1);
cfg::dat.bFullTransparent = cfg::getByte("CLUI", "fulltransparent", 0);
cfg::dat.bDblClkAvatars = cfg::getByte("CLC", "dblclkav", 0);
diff --git a/plugins/Clist_nicer/src/statusfloater.cpp b/plugins/Clist_nicer/src/statusfloater.cpp index 8ffa0fd9ec..4074606901 100644 --- a/plugins/Clist_nicer/src/statusfloater.cpp +++ b/plugins/Clist_nicer/src/statusfloater.cpp @@ -41,7 +41,7 @@ Also implementes floating contacts (FLT_*() functions) BYTE __forceinline percent_to_byte(UINT32 percent)
{
- return(BYTE) ((FLOAT) (((FLOAT) percent) / 100) * 255);
+ return(BYTE) ((FLOAT) (((FLOAT) percent) / 100) * 255);
}
void FLT_Update(struct ClcData *dat, ClcContact *contact);
@@ -78,41 +78,43 @@ static UINT padctrlIDs[] = { IDC_FLT_PADLEFTSPIN, IDC_FLT_PADRIGHTSPIN, IDC_FLT_ * simple linked list of allocated ContactFloater* structs
*/
-static ContactFloater *FLT_AddToList(ContactFloater *pFloater) {
- ContactFloater *pCurrent = pFirstFloater;
-
- if (!pFirstFloater) {
- pFirstFloater = pFloater;
- pFirstFloater->pNextFloater = NULL;
- return pFirstFloater;
- } else {
- while (pCurrent->pNextFloater != 0)
- pCurrent = pCurrent->pNextFloater;
- pCurrent->pNextFloater = pFloater;
- pFloater->pNextFloater = NULL;
- return pCurrent;
- }
+static ContactFloater *FLT_AddToList(ContactFloater *pFloater)
+{
+ ContactFloater *pCurrent = pFirstFloater;
+
+ if (!pFirstFloater) {
+ pFirstFloater = pFloater;
+ pFirstFloater->pNextFloater = NULL;
+ return pFirstFloater;
+ } else {
+ while (pCurrent->pNextFloater != 0)
+ pCurrent = pCurrent->pNextFloater;
+ pCurrent->pNextFloater = pFloater;
+ pFloater->pNextFloater = NULL;
+ return pCurrent;
+ }
}
-static ContactFloater *FLT_RemoveFromList(ContactFloater *pFloater) {
- ContactFloater *pCurrent = pFirstFloater;
-
- if (pFloater == pFirstFloater) {
- if (pFloater->pNextFloater != NULL)
- pFirstFloater = pFloater->pNextFloater;
- else
- pFirstFloater = NULL;
- return pFirstFloater;
- }
-
- do {
- if (pCurrent->pNextFloater == pFloater) {
- pCurrent->pNextFloater = pCurrent->pNextFloater->pNextFloater;
- return 0;
- }
- } while (pCurrent = pCurrent->pNextFloater);
+static ContactFloater *FLT_RemoveFromList(ContactFloater *pFloater)
+{
+ ContactFloater *pCurrent = pFirstFloater;
- return NULL;
+ if (pFloater == pFirstFloater) {
+ if (pFloater->pNextFloater != NULL)
+ pFirstFloater = pFloater->pNextFloater;
+ else
+ pFirstFloater = NULL;
+ return pFirstFloater;
+ }
+
+ do {
+ if (pCurrent->pNextFloater == pFloater) {
+ pCurrent->pNextFloater = pCurrent->pNextFloater->pNextFloater;
+ return 0;
+ }
+ } while (pCurrent = pCurrent->pNextFloater);
+
+ return NULL;
}
void FLT_SnapToEdges(HWND hwnd)
@@ -226,29 +228,26 @@ INT_PTR CALLBACK DlgProcFloatingContacts(HWND hwndDlg, UINT msg, WPARAM wParam, CheckDlgButton(hwndDlg, IDC_FLT_BORDER, dwFlags & FLT_BORDER);
SendMessage(hwndDlg, WM_COMMAND, (WPARAM)IDC_FLT_BORDER, 0);
CheckDlgButton(hwndDlg, IDC_FLT_ROUNDED, dwFlags & FLT_ROUNDED);
- CheckDlgButton(hwndDlg, IDC_FLT_FILLSTD, dwFlags & FLT_FILLSTDCOLOR);
+ CheckDlgButton(hwndDlg, IDC_FLT_FILLSTD, dwFlags & FLT_FILLSTDCOLOR);
SendMessage(hwndDlg, WM_COMMAND, (WPARAM)IDC_FLT_ROUNDED, 0);
- if (ServiceExists(MS_TOOLTIP_SHOWTIP))
- {
- CheckDlgButton(hwndDlg, IDC_FLT_SHOWTOOLTIPS, dwFlags & FLT_SHOWTOOLTIPS);
- SendMessage(hwndDlg, WM_COMMAND, (WPARAM)IDC_FLT_SHOWTOOLTIPS, 0);
- CheckDlgButton(hwndDlg, IDC_FLT_DEFHOVERTIME, g_floatoptions.def_hover_time);
- SendMessage(hwndDlg, WM_COMMAND, (WPARAM)IDC_FLT_DEFHOVERTIME, 0);
- }
- else
- {
- CheckDlgButton(hwndDlg, IDC_FLT_SHOWTOOLTIPS, 0);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_SHOWTOOLTIPS, 0);
- }
+ if (ServiceExists(MS_TOOLTIP_SHOWTIP)) {
+ CheckDlgButton(hwndDlg, IDC_FLT_SHOWTOOLTIPS, dwFlags & FLT_SHOWTOOLTIPS);
+ SendMessage(hwndDlg, WM_COMMAND, (WPARAM)IDC_FLT_SHOWTOOLTIPS, 0);
+ CheckDlgButton(hwndDlg, IDC_FLT_DEFHOVERTIME, g_floatoptions.def_hover_time);
+ SendMessage(hwndDlg, WM_COMMAND, (WPARAM)IDC_FLT_DEFHOVERTIME, 0);
+ }
+ else {
+ CheckDlgButton(hwndDlg, IDC_FLT_SHOWTOOLTIPS, 0);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_SHOWTOOLTIPS, 0);
+ }
for (i = 0; padctrlIDs[i] != 0; i++)
SendDlgItemMessage(hwndDlg, padctrlIDs[i], UDM_SETRANGE, 0, MAKELONG(20, 0));
SendDlgItemMessage(hwndDlg, IDC_FLT_WIDTHSPIN, UDM_SETRANGE, 0, MAKELONG(200, 50));
SendDlgItemMessage(hwndDlg, IDC_FLT_RADIUSSPIN, UDM_SETRANGE, 0, MAKELONG(20, 1));
- SendDlgItemMessage(hwndDlg, IDC_FLT_HOVERTIMESPIN, UDM_SETRANGE, 0, MAKELONG(5000, 1));
-
+ SendDlgItemMessage(hwndDlg, IDC_FLT_HOVERTIMESPIN, UDM_SETRANGE, 0, MAKELONG(5000, 1));
SendDlgItemMessage(hwndDlg, IDC_FLT_PADLEFTSPIN, UDM_SETPOS, 0, (LPARAM)g_floatoptions.pad_left);
SendDlgItemMessage(hwndDlg, IDC_FLT_PADRIGHTSPIN, UDM_SETPOS, 0, (LPARAM)g_floatoptions.pad_right);
@@ -256,7 +255,7 @@ INT_PTR CALLBACK DlgProcFloatingContacts(HWND hwndDlg, UINT msg, WPARAM wParam, SendDlgItemMessage(hwndDlg, IDC_FLT_PADBOTTOMSPIN, UDM_SETPOS, 0, (LPARAM)g_floatoptions.pad_top);
SendDlgItemMessage(hwndDlg, IDC_FLT_WIDTHSPIN, UDM_SETPOS, 0, (LPARAM)g_floatoptions.width);
SendDlgItemMessage(hwndDlg, IDC_FLT_RADIUSSPIN, UDM_SETPOS, 0, (LPARAM)g_floatoptions.radius);
- SendDlgItemMessage(hwndDlg, IDC_FLT_HOVERTIMESPIN, UDM_SETPOS, 0, (LPARAM)g_floatoptions.hover_time);
+ SendDlgItemMessage(hwndDlg, IDC_FLT_HOVERTIMESPIN, UDM_SETPOS, 0, (LPARAM)g_floatoptions.hover_time);
SendDlgItemMessage(hwndDlg, IDC_FLT_ACTIVEOPACITY, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
SendDlgItemMessage(hwndDlg, IDC_FLT_ACTIVEOPACITY, TBM_SETPOS, TRUE, g_floatoptions.act_trans);
@@ -268,111 +267,104 @@ INT_PTR CALLBACK DlgProcFloatingContacts(HWND hwndDlg, UINT msg, WPARAM wParam, SendDlgItemMessage(hwndDlg, IDC_FLT_BORDERCOLOUR, CPM_SETCOLOUR, 0, g_floatoptions.border_colour);
FLT_ShowHideAll(SW_SHOWNOACTIVATE);
-
- return TRUE;
}
+ return TRUE;
+
case WM_COMMAND:
switch(LOWORD(wParam)) {
- case IDC_FLT_ENABLED:
- {
- int isEnabled = IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED);
- int isSimple = IsDlgButtonChecked(hwndDlg, IDC_FLT_SIMPLELAYOUT);
- int isBorder = IsDlgButtonChecked(hwndDlg, IDC_FLT_BORDER);
- int isRounded = IsDlgButtonChecked(hwndDlg, IDC_FLT_ROUNDED);
- int isTooltip = IsDlgButtonChecked(hwndDlg, IDC_FLT_SHOWTOOLTIPS);
- int isDefHoverTime = IsDlgButtonChecked(hwndDlg, IDC_FLT_DEFHOVERTIME);
-
- Utils::enableDlgControl(hwndDlg, IDC_FLT_SIMPLELAYOUT, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_SYNCED, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_AUTOHIDE, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_SNAP, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_ACTIVEOPACITY, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_OPACITY, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_PADLEFTSPIN, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_PADRIGHTSPIN, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_PADTOPSPIN, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_PADLEFT, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_PADRIGHT, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_PADTOP, isEnabled);
- //EnableWindow(GetDlgItem(hwndDlg, IDC_FLT_PADBOTTOMSPIN), isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_PADBOTTOM, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_WIDTHSPIN, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_WIDTH, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_BORDER, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_ROUNDED, isEnabled);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_BORDERCOLOUR, isEnabled & isBorder);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_RADIUS, isEnabled & isRounded);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_RADIUSSPIN, isEnabled & isRounded);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_SHOWTOOLTIPS, isEnabled & ServiceExists(MS_TOOLTIP_SHOWTIP));
- Utils::enableDlgControl(hwndDlg, IDC_FLT_DEFHOVERTIME, isEnabled & isTooltip);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_HOVERTIME, isEnabled & isTooltip & !isDefHoverTime);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_HOVERTIMESPIN, isEnabled & isTooltip & !isDefHoverTime);
-
- Utils::enableDlgControl(hwndDlg, IDC_FLT_AVATARS, isEnabled & !isSimple);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_EXTRAICONS, isEnabled & !isSimple);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_DUALROWS, isEnabled & !isSimple);
- }
- break;
- case IDC_FLT_SIMPLELAYOUT:
- {
- if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)) {
- int isSimple = IsDlgButtonChecked(hwndDlg, IDC_FLT_SIMPLELAYOUT);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_AVATARS, !isSimple);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_EXTRAICONS, !isSimple);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_DUALROWS, !isSimple);
- }
- }
- break;
- case IDC_FLT_BORDER:
- {
- if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)) {
- int isBorder = IsDlgButtonChecked(hwndDlg, IDC_FLT_BORDER);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_BORDERCOLOUR, isBorder);
- }
- }
- break;
- case IDC_FLT_ROUNDED:
- {
- if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)) {
- int isRounded = IsDlgButtonChecked(hwndDlg, IDC_FLT_ROUNDED);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_RADIUS, isRounded);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_RADIUSSPIN, isRounded);
- }
- }
- break;
- case IDC_FLT_SHOWTOOLTIPS:
- {
- if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)) {
- int isTooltip = IsDlgButtonChecked(hwndDlg, IDC_FLT_SHOWTOOLTIPS);
- int isDefHoverTime = IsDlgButtonChecked(hwndDlg, IDC_FLT_DEFHOVERTIME);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_DEFHOVERTIME, isTooltip);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_HOVERTIME, isTooltip & !isDefHoverTime);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_HOVERTIMESPIN, isTooltip & !isDefHoverTime);
- }
- }
- break;
- case IDC_FLT_DEFHOVERTIME:
- {
- if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED) && IsDlgButtonChecked(hwndDlg, IDC_FLT_SHOWTOOLTIPS)) {
- int isDefHoverTime = IsDlgButtonChecked(hwndDlg, IDC_FLT_DEFHOVERTIME);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_HOVERTIME, !isDefHoverTime);
- Utils::enableDlgControl(hwndDlg, IDC_FLT_HOVERTIMESPIN, !isDefHoverTime);
- }
- }
- break;
-
- case IDC_FLT_PADTOP:
- {
- if (HIWORD(wParam) == EN_CHANGE){
- int value = SendDlgItemMessage(hwndDlg, IDC_FLT_PADTOPSPIN, UDM_GETPOS, 0, 0);
- SendDlgItemMessage(hwndDlg, IDC_FLT_PADBOTTOMSPIN, UDM_SETPOS, 0, (LPARAM)value);
- }
- }
- break;
- break;
+ case IDC_FLT_ENABLED:
+ {
+ int isEnabled = IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED);
+ int isSimple = IsDlgButtonChecked(hwndDlg, IDC_FLT_SIMPLELAYOUT);
+ int isBorder = IsDlgButtonChecked(hwndDlg, IDC_FLT_BORDER);
+ int isRounded = IsDlgButtonChecked(hwndDlg, IDC_FLT_ROUNDED);
+ int isTooltip = IsDlgButtonChecked(hwndDlg, IDC_FLT_SHOWTOOLTIPS);
+ int isDefHoverTime = IsDlgButtonChecked(hwndDlg, IDC_FLT_DEFHOVERTIME);
+
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_SIMPLELAYOUT, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_SYNCED, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_AUTOHIDE, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_SNAP, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_ACTIVEOPACITY, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_OPACITY, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_PADLEFTSPIN, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_PADRIGHTSPIN, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_PADTOPSPIN, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_PADLEFT, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_PADRIGHT, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_PADTOP, isEnabled);
+ //EnableWindow(GetDlgItem(hwndDlg, IDC_FLT_PADBOTTOMSPIN), isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_PADBOTTOM, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_WIDTHSPIN, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_WIDTH, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_BORDER, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_ROUNDED, isEnabled);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_BORDERCOLOUR, isEnabled & isBorder);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_RADIUS, isEnabled & isRounded);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_RADIUSSPIN, isEnabled & isRounded);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_SHOWTOOLTIPS, isEnabled & ServiceExists(MS_TOOLTIP_SHOWTIP));
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_DEFHOVERTIME, isEnabled & isTooltip);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_HOVERTIME, isEnabled & isTooltip & !isDefHoverTime);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_HOVERTIMESPIN, isEnabled & isTooltip & !isDefHoverTime);
+
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_AVATARS, isEnabled & !isSimple);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_EXTRAICONS, isEnabled & !isSimple);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_DUALROWS, isEnabled & !isSimple);
+ }
+ break;
+
+ case IDC_FLT_SIMPLELAYOUT:
+ if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)) {
+ int isSimple = IsDlgButtonChecked(hwndDlg, IDC_FLT_SIMPLELAYOUT);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_AVATARS, !isSimple);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_EXTRAICONS, !isSimple);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_DUALROWS, !isSimple);
+ }
+ break;
+
+ case IDC_FLT_BORDER:
+ if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)) {
+ int isBorder = IsDlgButtonChecked(hwndDlg, IDC_FLT_BORDER);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_BORDERCOLOUR, isBorder);
+ }
+ break;
+
+ case IDC_FLT_ROUNDED:
+ if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)) {
+ int isRounded = IsDlgButtonChecked(hwndDlg, IDC_FLT_ROUNDED);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_RADIUS, isRounded);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_RADIUSSPIN, isRounded);
+ }
+ break;
+
+ case IDC_FLT_SHOWTOOLTIPS:
+ if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)) {
+ int isTooltip = IsDlgButtonChecked(hwndDlg, IDC_FLT_SHOWTOOLTIPS);
+ int isDefHoverTime = IsDlgButtonChecked(hwndDlg, IDC_FLT_DEFHOVERTIME);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_DEFHOVERTIME, isTooltip);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_HOVERTIME, isTooltip & !isDefHoverTime);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_HOVERTIMESPIN, isTooltip & !isDefHoverTime);
+ }
+ break;
+
+ case IDC_FLT_DEFHOVERTIME:
+ if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED) && IsDlgButtonChecked(hwndDlg, IDC_FLT_SHOWTOOLTIPS)) {
+ int isDefHoverTime = IsDlgButtonChecked(hwndDlg, IDC_FLT_DEFHOVERTIME);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_HOVERTIME, !isDefHoverTime);
+ Utils::enableDlgControl(hwndDlg, IDC_FLT_HOVERTIMESPIN, !isDefHoverTime);
+ }
+ break;
+
+ case IDC_FLT_PADTOP:
+ if (HIWORD(wParam) == EN_CHANGE){
+ int value = SendDlgItemMessage(hwndDlg, IDC_FLT_PADTOPSPIN, UDM_GETPOS, 0, 0);
+ SendDlgItemMessage(hwndDlg, IDC_FLT_PADBOTTOMSPIN, UDM_SETPOS, 0, (LPARAM)value);
+ }
+ break;
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
+
case WM_HSCROLL:
{
char str[10];
@@ -385,53 +377,51 @@ INT_PTR CALLBACK DlgProcFloatingContacts(HWND hwndDlg, UINT msg, WPARAM wParam, SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
break;
+
case WM_NOTIFY:
- switch (((LPNMHDR) lParam)->idFrom) {
- case 0:
- switch (((LPNMHDR) lParam)->code) {
- case PSN_APPLY:
- {
- g_floatoptions.enabled = IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED) ? 1 : 0;
- g_floatoptions.dwFlags = 0;
-
- if (IsDlgButtonChecked(hwndDlg, IDC_FLT_SIMPLELAYOUT))
- g_floatoptions.dwFlags = FLT_SIMPLE;
-
- g_floatoptions.dwFlags |= (IsDlgButtonChecked(hwndDlg, IDC_FLT_AVATARS) ? FLT_AVATARS : 0) |
- (IsDlgButtonChecked(hwndDlg, IDC_FLT_DUALROWS) ? FLT_DUALROW : 0) |
- (IsDlgButtonChecked(hwndDlg, IDC_FLT_EXTRAICONS) ? FLT_EXTRAICONS : 0) |
- (IsDlgButtonChecked(hwndDlg, IDC_FLT_SYNCED) ? FLT_SYNCWITHCLIST : 0) |
- (IsDlgButtonChecked(hwndDlg, IDC_FLT_AUTOHIDE) ? FLT_AUTOHIDE : 0) |
- (IsDlgButtonChecked(hwndDlg, IDC_FLT_SNAP) ? FLT_SNAP : 0) |
- (IsDlgButtonChecked(hwndDlg, IDC_FLT_BORDER) ? FLT_BORDER : 0) |
- (IsDlgButtonChecked(hwndDlg, IDC_FLT_FILLSTD) ? FLT_FILLSTDCOLOR : 0) |
- (IsDlgButtonChecked(hwndDlg, IDC_FLT_SHOWTOOLTIPS) ? FLT_SHOWTOOLTIPS : 0) |
- (IsDlgButtonChecked(hwndDlg, IDC_FLT_ROUNDED) ? FLT_ROUNDED : 0);
-
- g_floatoptions.act_trans = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_ACTIVEOPACITY, TBM_GETPOS, 0, 0);
- g_floatoptions.trans = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_OPACITY, TBM_GETPOS, 0, 0);
- g_floatoptions.pad_left = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_PADLEFTSPIN, UDM_GETPOS, 0, 0);
- g_floatoptions.pad_right = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_PADRIGHTSPIN, UDM_GETPOS, 0, 0);
- g_floatoptions.pad_top = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_PADTOPSPIN, UDM_GETPOS, 0, 0);
- g_floatoptions.pad_bottom = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_PADBOTTOMSPIN, UDM_GETPOS, 0, 0);
- g_floatoptions.width = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_WIDTHSPIN, UDM_GETPOS, 0, 0);
- g_floatoptions.radius = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_RADIUSSPIN, UDM_GETPOS, 0, 0);
- g_floatoptions.border_colour = SendDlgItemMessage(hwndDlg, IDC_FLT_BORDERCOLOUR, CPM_GETCOLOUR, 0, 0);
-
- g_floatoptions.def_hover_time= IsDlgButtonChecked(hwndDlg, IDC_FLT_DEFHOVERTIME) ? 1 : 0;
- if (g_floatoptions.def_hover_time)
- g_floatoptions.hover_time = cfg::getWord("CLC", "InfoTipHoverTime", 200);
- else
- g_floatoptions.hover_time = (WORD)SendDlgItemMessage(hwndDlg, IDC_FLT_HOVERTIMESPIN, UDM_GETPOS, 0, 0);
-
- FLT_WriteOptions();
- FLT_RefreshAll();
- return TRUE;
- }
- }
- break;
- }
- break;
+ switch (((LPNMHDR) lParam)->idFrom) {
+ case 0:
+ if (((LPNMHDR) lParam)->code == PSN_APPLY) {
+ g_floatoptions.enabled = IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED) ? 1 : 0;
+ g_floatoptions.dwFlags = 0;
+
+ if (IsDlgButtonChecked(hwndDlg, IDC_FLT_SIMPLELAYOUT))
+ g_floatoptions.dwFlags = FLT_SIMPLE;
+
+ g_floatoptions.dwFlags |= (IsDlgButtonChecked(hwndDlg, IDC_FLT_AVATARS) ? FLT_AVATARS : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_FLT_DUALROWS) ? FLT_DUALROW : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_FLT_EXTRAICONS) ? FLT_EXTRAICONS : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_FLT_SYNCED) ? FLT_SYNCWITHCLIST : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_FLT_AUTOHIDE) ? FLT_AUTOHIDE : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_FLT_SNAP) ? FLT_SNAP : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_FLT_BORDER) ? FLT_BORDER : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_FLT_FILLSTD) ? FLT_FILLSTDCOLOR : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_FLT_SHOWTOOLTIPS) ? FLT_SHOWTOOLTIPS : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_FLT_ROUNDED) ? FLT_ROUNDED : 0);
+
+ g_floatoptions.act_trans = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_ACTIVEOPACITY, TBM_GETPOS, 0, 0);
+ g_floatoptions.trans = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_OPACITY, TBM_GETPOS, 0, 0);
+ g_floatoptions.pad_left = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_PADLEFTSPIN, UDM_GETPOS, 0, 0);
+ g_floatoptions.pad_right = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_PADRIGHTSPIN, UDM_GETPOS, 0, 0);
+ g_floatoptions.pad_top = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_PADTOPSPIN, UDM_GETPOS, 0, 0);
+ g_floatoptions.pad_bottom = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_PADBOTTOMSPIN, UDM_GETPOS, 0, 0);
+ g_floatoptions.width = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_WIDTHSPIN, UDM_GETPOS, 0, 0);
+ g_floatoptions.radius = (BYTE)SendDlgItemMessage(hwndDlg, IDC_FLT_RADIUSSPIN, UDM_GETPOS, 0, 0);
+ g_floatoptions.border_colour = SendDlgItemMessage(hwndDlg, IDC_FLT_BORDERCOLOUR, CPM_GETCOLOUR, 0, 0);
+
+ g_floatoptions.def_hover_time= IsDlgButtonChecked(hwndDlg, IDC_FLT_DEFHOVERTIME) ? 1 : 0;
+ if (g_floatoptions.def_hover_time)
+ g_floatoptions.hover_time = cfg::getWord("CLC", "InfoTipHoverTime", 200);
+ else
+ g_floatoptions.hover_time = (WORD)SendDlgItemMessage(hwndDlg, IDC_FLT_HOVERTIMESPIN, UDM_GETPOS, 0, 0);
+
+ FLT_WriteOptions();
+ FLT_RefreshAll();
+ return TRUE;
+ }
+ break;
+ }
+ break;
}
return FALSE;
}
@@ -1079,7 +1069,6 @@ void FLT_Update(struct ClcData *dat, ClcContact *contact) if (FindItem(pcli->hwndContactTree, dat, contact->hContact, &newContact, &group, 0)) {
DWORD oldFlags = cfg::dat.dwFlags;
BYTE oldPadding = cfg::dat.avatarPadding;
- DWORD oldExtraImageMask = cfg::eCache[contact->extraCacheEntry].dwXMask;
struct avatarCacheEntry *ace_old = contact->ace;
BYTE oldDualRow = contact->bSecondLine;
@@ -1090,52 +1079,47 @@ void FLT_Update(struct ClcData *dat, ClcContact *contact) contact->ace = 0;
contact->bSecondLine = MULTIROW_NEVER;
cfg::dat.dwFlags &= ~(CLUI_SHOWCLIENTICONS | CLUI_SHOWVISI);
- cfg::eCache[contact->extraCacheEntry].dwXMask = 0;
}
- else{
+ else {
if (!(g_floatoptions.dwFlags & FLT_AVATARS)) {
- contact->ace = 0;
- g_list_avatars = 0;
- }
- else
- g_list_avatars = 1;
-
- if (!(g_floatoptions.dwFlags & FLT_DUALROW))
- contact->bSecondLine = MULTIROW_NEVER;
+ contact->ace = 0;
+ g_list_avatars = 0;
+ }
+ else
+ g_list_avatars = 1;
+
+ if (!(g_floatoptions.dwFlags & FLT_DUALROW))
+ contact->bSecondLine = MULTIROW_NEVER;
else
contact->bSecondLine = MULTIROW_ALWAYS;
- if (!(g_floatoptions.dwFlags & FLT_EXTRAICONS)) {
+ if (!(g_floatoptions.dwFlags & FLT_EXTRAICONS))
cfg::dat.dwFlags &= ~(CLUI_SHOWCLIENTICONS | CLUI_SHOWVISI);
- cfg::eCache[contact->extraCacheEntry].dwXMask = 0;
- }
}
- //g_CluiData.avatarPadding = g_floatoptions.pad_top;
dat->leftMargin = g_floatoptions.pad_left;
dat->rightMargin = g_floatoptions.pad_right;
g_HDC = hdc;
- hdcTempAV = CreateCompatibleDC(g_HDC);
- hdcAV = CreateCompatibleDC(g_HDC);
- hbmTempAV = CreateCompatibleBitmap(g_HDC, g_maxAV_X, g_maxAV_Y);
- hbmTempOldAV = reinterpret_cast<HBITMAP>(SelectObject(hdcTempAV, hbmTempAV));
+ hdcTempAV = CreateCompatibleDC(g_HDC);
+ hdcAV = CreateCompatibleDC(g_HDC);
+ hbmTempAV = CreateCompatibleBitmap(g_HDC, g_maxAV_X, g_maxAV_Y);
+ hbmTempOldAV = reinterpret_cast<HBITMAP>(SelectObject(hdcTempAV, hbmTempAV));
- g_padding_y = g_floatoptions.pad_top;
+ g_padding_y = g_floatoptions.pad_top;
PaintItem(hdc, group, contact, 0, 0, dat, -4, pcli->hwndContactTree, 0, &rcClient, &firstDrawn, 0, rcClient.bottom - rcClient.top);
- g_padding_y = 0;
+ g_padding_y = 0;
- SelectObject(hdcTempAV, hbmTempOldAV);
- DeleteObject(hbmTempAV);
- DeleteDC(hdcTempAV);
- DeleteDC(hdcAV);
+ SelectObject(hdcTempAV, hbmTempOldAV);
+ DeleteObject(hbmTempAV);
+ DeleteDC(hdcTempAV);
+ DeleteDC(hdcAV);
cfg::dat.dwFlags = oldFlags;
cfg::dat.avatarPadding = oldPadding;
contact->ace = ace_old;
contact->bSecondLine = oldDualRow;
- cfg::eCache[contact->extraCacheEntry].dwXMask = oldExtraImageMask;
dat->leftMargin = oldLeftMargin;
dat->rightMargin = oldRightMargin;
@@ -1173,19 +1157,19 @@ void FLT_SyncWithClist() ClcContact *contact;
ContactFloater *pCurrent = pFirstFloater;
HWND hwnd;
- int iVis = pcli->pfnGetWindowVisibleState(pcli->hwndContactList, 0, 0);
+ int iVis = pcli->pfnGetWindowVisibleState(pcli->hwndContactList, 0, 0);
if (g_floatoptions.dwFlags & FLT_SYNCWITHCLIST){
while(pCurrent) {
hwnd = pCurrent->hwnd;
if (hwnd && IsWindow(hwnd)) {
if (FindItem(pcli->hwndContactTree, cfg::clcdat, pCurrent->hContact, &contact, NULL, 0)) {
- FLT_Update(cfg::clcdat, contact);
- if (((g_floatoptions.dwFlags & FLT_AUTOHIDE) && (iVis == 2 || iVis == 4)) || !(g_floatoptions.dwFlags & FLT_AUTOHIDE))
- ShowWindow(hwnd, SW_SHOWNOACTIVATE);
- else
- ShowWindow(hwnd, SW_HIDE);
- }
+ FLT_Update(cfg::clcdat, contact);
+ if (((g_floatoptions.dwFlags & FLT_AUTOHIDE) && (iVis == 2 || iVis == 4)) || !(g_floatoptions.dwFlags & FLT_AUTOHIDE))
+ ShowWindow(hwnd, SW_SHOWNOACTIVATE);
+ else
+ ShowWindow(hwnd, SW_HIDE);
+ }
else
ShowWindow(hwnd, SW_HIDE);
}
|