diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-11 12:24:51 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-11 12:24:51 +0000 |
commit | 65bcbfe440cf50e8a5df9b708da553fbda429d15 (patch) | |
tree | 5b9ae699ee89598307296aacce513a814d8e31f7 /plugins/Clist_modern/modern_toolbar.cpp | |
parent | e101f83e1e4ba4a9d473a9bc74ca88c9a8e73f36 (diff) |
- improved bug compatibility with Clist Modern;
- standard variable names;
- useless code & data removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@902 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/modern_toolbar.cpp')
-rw-r--r-- | plugins/Clist_modern/modern_toolbar.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/plugins/Clist_modern/modern_toolbar.cpp b/plugins/Clist_modern/modern_toolbar.cpp index 10a1bda377..91da73a04d 100644 --- a/plugins/Clist_modern/modern_toolbar.cpp +++ b/plugins/Clist_modern/modern_toolbar.cpp @@ -50,7 +50,10 @@ static BTNS[] = { "Minimize","Minimize", "CList/ShowHide", "Minimize", NULL, 180 , IDI_RESETVIEW, IDI_RESETVIEW, FALSE }
};
-void SetButtonPressed(HANDLE hButton, int state);
+static void SetButtonPressed(int i, int state)
+{
+ CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[i].hButton, state ? TTBST_PUSHED : TTBST_RELEASED);
+}
static int Modern_InitButtons(WPARAM, LPARAM)
{
@@ -83,9 +86,9 @@ static int Modern_InitButtons(WPARAM, LPARAM) BTNS[i].hButton = TopToolbar_AddButton(&tbb);
}
- SetButtonPressed(BTNS[3].hButton, db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
- SetButtonPressed(BTNS[6].hButton, db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT));
- SetButtonPressed(BTNS[7].hButton, db_get_b(NULL, "Skin", "UseSound", SETTING_ENABLESOUNDS_DEFAULT));
+ SetButtonPressed(3, db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
+ SetButtonPressed(6, db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT));
+ SetButtonPressed(7, !db_get_b(NULL, "Skin", "UseSound", SETTING_ENABLESOUNDS_DEFAULT));
return 1;
}
@@ -126,13 +129,13 @@ static int ehhToolBarSettingsChanged(WPARAM wParam, LPARAM lParam) if (!mir_strcmp(cws->szModule,"CList")) {
if (!mir_strcmp(cws->szSetting,"HideOffline"))
- SetButtonPressed(BTNS[3].hButton, cws->value.bVal);
+ SetButtonPressed(3, cws->value.bVal);
else if (!mir_strcmp(cws->szSetting,"UseGroups"))
- SetButtonPressed(BTNS[6].hButton, cws->value.bVal);
+ SetButtonPressed(6, cws->value.bVal);
}
else if (!mir_strcmp(cws->szModule,"Skin")) {
if (!mir_strcmp(cws->szSetting,"UseSound"))
- SetButtonPressed(BTNS[7].hButton, cws->value.bVal);
+ SetButtonPressed(7, !cws->value.bVal);
}
return 0;
|