diff options
Diffstat (limited to 'plugins/Clist_nicer/SRC')
-rw-r--r-- | plugins/Clist_nicer/SRC/CLCButton.cpp | 30 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/clc.cpp | 4 |
2 files changed, 25 insertions, 9 deletions
diff --git a/plugins/Clist_nicer/SRC/CLCButton.cpp b/plugins/Clist_nicer/SRC/CLCButton.cpp index 1b917fea47..2af22400ce 100644 --- a/plugins/Clist_nicer/SRC/CLCButton.cpp +++ b/plugins/Clist_nicer/SRC/CLCButton.cpp @@ -51,14 +51,16 @@ static int g_index = -1; static int InitDefaultButtons(WPARAM, LPARAM)
{
- TTBButton tbb = { 0 };
- tbb.cbSize = sizeof(tbb);
-
for (int i=0; i < SIZEOF(BTNS); i++ ) {
+ TTBButton tbb = { 0 };
+ tbb.cbSize = sizeof(tbb);
+
g_index = i;
if (BTNS[i].pszButtonID) {
+ if ( !BTNS[i].isPush)
+ tbb.dwFlags |= TTBBF_ASPUSHBUTTON;
+
tbb.pszTooltipUp = tbb.name = LPGEN(BTNS[i].pszButtonName);
- tbb.pszService = BTNS[i].pszButtonID;
tbb.hIconHandleUp = Skin_GetIconHandle(BTNS[i].pszButtonID);
if (BTNS[i].pszButtonDn)
tbb.hIconHandleUp = Skin_GetIconHandle(BTNS[i].pszButtonDn);
@@ -69,9 +71,22 @@ static int InitDefaultButtons(WPARAM, LPARAM) BTNS[i].hButton = TopToolbar_AddButton(&tbb);
}
g_index = -1;
+
+ ClcSetButtonState(IDC_TBHIDEOFFLINE, db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
+ ClcSetButtonState(IDC_TBHIDEGROUPS, db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT));
+ ClcSetButtonState(IDC_TBSOUND, db_get_b(NULL, "Skin", "UseSound", 1));
return 1;
}
+void ClcSetButtonState(int ctrlid, int status)
+{
+ for (int i=0; i < SIZEOF(BTNS); i++)
+ if (BTNS[i].ctrlid == ctrlid) {
+ CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[i].hButton, status ? TTBST_PUSHED : TTBST_RELEASED);
+ break;
+ }
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
struct MButtonExtension : public MButtonCtrl
@@ -421,6 +436,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR break;
case WM_LBUTTONDOWN:
+ if (!bct->iCtrlID) return 0;
if (bct->stateId != PBS_DISABLED && bct->stateId != PBS_PRESSED) {
bct->stateId = PBS_PRESSED;
InvalidateRect(bct->hwnd, NULL, TRUE);
@@ -433,6 +449,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR return 1;
case WM_LBUTTONUP:
+ if (!bct->iCtrlID) return 0;
if (bct->bIsPushBtn)
bct->bIsPushed = !bct->bIsPushed;
@@ -467,10 +484,9 @@ static void SetButtonAsCustom(HWND hWnd) static LRESULT CALLBACK ToolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- if (msg == WM_COMMAND && HIWORD(wParam) == BN_CLICKED) {
+ if (msg == WM_COMMAND && HIWORD(wParam) == BN_CLICKED)
SendMessage(pcli->hwndContactList, msg, wParam, lParam);
- return 1;
- }
+
return 0;
}
diff --git a/plugins/Clist_nicer/SRC/clc.cpp b/plugins/Clist_nicer/SRC/clc.cpp index 7d6ce337f3..b63a77a7bb 100644 --- a/plugins/Clist_nicer/SRC/clc.cpp +++ b/plugins/Clist_nicer/SRC/clc.cpp @@ -169,8 +169,8 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam) pcli->pfnClcBroadcast(INTM_NAMEORDERCHANGED, wParam, lParam);
}
if (!__strcmp(cws->szSetting, "UseSound")) {
- cfg::dat.soundsOff = cfg::getByte(cws->szModule, cws->szSetting, 0) ? 0 : 1;
- CheckDlgButton(pcli->hwndContactList, IDC_TBSOUND, cfg::dat.soundsOff ? BST_UNCHECKED : BST_CHECKED);
+ cfg::dat.soundsOff = cws->value.bVal ? 0 : 1;
+ ClcSetButtonState(IDC_TBSOUND, cfg::dat.soundsOff);
}
}
if (cfg::dat.bMetaAvail && cfg::dat.bMetaEnabled && !__strcmp(cws->szModule, cfg::dat.szMetaName) && !__strcmp(cws->szSetting, "IsSubcontact"))
|