summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-10 11:51:00 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-10 11:51:00 +0000
commit03758f8f918f392386a1dd7a1c7a795927f8c221 (patch)
treedc4dede8653397df0275f49e730b0d44605d7a7c /plugins/Clist_nicer/src
parent1416051048756ab769de52ab5eb67a31e41524fd (diff)
- ME_TTB_INITBUTTONS event considered useless;
- clist_modern & clist_nicer are trained to reload TTB buttons when TopToolBar plugin is loaded dynamically; - TTB processing code slightly reordered git-svn-id: http://svn.miranda-ng.org/main/trunk@3953 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/src')
-rw-r--r--plugins/Clist_nicer/src/CLCButton.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp
index 9d4afe9b5b..b5c51182d6 100644
--- a/plugins/Clist_nicer/src/CLCButton.cpp
+++ b/plugins/Clist_nicer/src/CLCButton.cpp
@@ -64,7 +64,7 @@ static int getButtonIndex(HANDLE hButton)
return -1;
}
-static int InitDefaultButtons(WPARAM, LPARAM)
+static void InitDefaultButtons()
{
for (int i=0; i < SIZEOF(BTNS); i++ ) {
TTBButton tbb = { 0 };
@@ -90,7 +90,6 @@ static int InitDefaultButtons(WPARAM, LPARAM)
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)
@@ -520,6 +519,8 @@ static void CustomizeToolbar(HANDLE hButton, HWND hWnd, LPARAM)
if (hButton == TTB_WINDOW_HANDLE) {
TTBCtrlCustomize custData = { sizeof(TTBCtrl), ToolbarWndProc };
SendMessage(hWnd, TTB_SETCUSTOM, 0, (LPARAM)&custData);
+
+ InitDefaultButtons();
return;
}
@@ -552,12 +553,20 @@ void CustomizeButton(HWND hWnd, bool bIsSkinned, bool bIsThemed, bool bIsFlat)
static int Nicer_CustomizeToolbar(WPARAM, LPARAM)
{
- HookEvent(ME_TTB_INITBUTTONS, InitDefaultButtons);
TopToolbar_SetCustomProc(CustomizeToolbar, 0);
return 0;
}
+static int Nicer_ReloadToolbar(WPARAM wParam, LPARAM)
+{
+ PLUGININFOEX *pInfo = (PLUGININFOEX*)wParam;
+ if ( !_stricmp(pInfo->shortName, "TopToolBar"))
+ TopToolbar_SetCustomProc(CustomizeToolbar, 0);
+ return 0;
+}
+
void LoadButtonModule()
{
+ HookEvent(ME_SYSTEM_MODULELOAD, Nicer_ReloadToolbar);
HookEvent(ME_SYSTEM_MODULESLOADED, Nicer_CustomizeToolbar);
}