diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-07 20:38:34 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-07 20:38:34 +0000 |
commit | 37690f6a83f2935292f28cdec8340c206a2f3aac (patch) | |
tree | bbd87013cecd8dc3aa06cf5a7cfe707de657cde7 /plugins/Clist_modern | |
parent | 990064649ebc7b3df17b3784b6c38d6a09df39ec (diff) |
fix for top toolbar drawing in Clist Nicer & Clist Modern
git-svn-id: http://svn.miranda-ng.org/main/trunk@838 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r-- | plugins/Clist_modern/modern_tbbutton.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/plugins/Clist_modern/modern_tbbutton.cpp b/plugins/Clist_modern/modern_tbbutton.cpp index 2f38cc25e3..8b4941f69d 100644 --- a/plugins/Clist_modern/modern_tbbutton.cpp +++ b/plugins/Clist_modern/modern_tbbutton.cpp @@ -4,6 +4,7 @@ #include "hdr/modern_clcpaint.h"
#include <m_button_int.h>
+#include <m_toptoolbar.h>
#ifdef __MINGW32__
#include <ctype.h>
@@ -248,11 +249,8 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam case WM_DESTROY:
xpt_FreeThemeForWindow(hwndDlg);
WindowList_Remove(hButtonWindowList, hwndDlg);
- if (lpSBData) {
- if (lpSBData->hIconPrivate)
- DestroyIcon(lpSBData->hIconPrivate);
- free(lpSBData); // lpSBData was malloced by native malloc
- }
+ if (lpSBData->hIconPrivate)
+ DestroyIcon(lpSBData->hIconPrivate);
break; // DONT! fall thru
case WM_SETTEXT:
@@ -519,23 +517,29 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam return 0;
}
-void CustomizeButton(HWND hwnd)
+static void CustomizeButton(HANDLE ttbid, HWND hWnd, LPARAM lParam)
{
MButtonCustomize Custom;
Custom.cbLen = sizeof(TBBUTTONDATA);
Custom.fnPainter = (pfnPainterFunc)PaintWorker;
Custom.fnWindowProc = ToolbarButtonProc;
- SendMessage(hwnd, BUTTONSETCUSTOM, 0, (LPARAM)&Custom);
+ SendMessage(hWnd, BUTTONSETCUSTOM, 0, (LPARAM)&Custom);
- TBBUTTONDATA* p = (TBBUTTONDATA*)GetWindowLongPtr(hwnd, 0);
+ TBBUTTONDATA* p = (TBBUTTONDATA*)GetWindowLongPtr(hWnd, 0);
p->nFontID = -1;
p->hThemeButton = xpt_AddThemeHandle(p->hwnd, L"BUTTON");
p->hThemeToolbar = xpt_AddThemeHandle(p->hwnd, L"TOOLBAR");
- WindowList_Add(hButtonWindowList, hwnd, NULL);
+ WindowList_Add(hButtonWindowList, hWnd, NULL);
}
/////////////////////////////////////////////////////////////////////////////////////////
+int Buttons_ModuleLoaded(WPARAM wParam, LPARAM lParam)
+{
+ TopToolbar_SetCustomProc(CustomizeButton, 0);
+ return 0;
+}
+
int Buttons_OnSkinModeSettingsChanged(WPARAM wParam, LPARAM lParam)
{
WindowList_BroadcastAsync(hButtonWindowList, MBM_UPDATETRANSPARENTFLAG,0,2);
@@ -544,6 +548,8 @@ int Buttons_OnSkinModeSettingsChanged(WPARAM wParam, LPARAM lParam) HRESULT ToolbarButtonLoadModule()
{
+ HookEvent(ME_SYSTEM_MODULESLOADED, Buttons_ModuleLoaded);
+
hButtonWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
hIconChangedHook = HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
hBkgChangedHook = HookEvent(ME_BACKGROUNDCONFIG_CHANGED,Buttons_OnSkinModeSettingsChanged);
|