summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/modern_tbbutton.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-10 19:12:33 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-10 19:12:33 +0000
commit7334ecff1581f0294e6fa7f594f828f85d45abb5 (patch)
tree5d16997f326a1d6ad0e3921c5ce9623817d55f9a /plugins/Clist_modern/modern_tbbutton.cpp
parent9242a80a84fa5c96dbadec9594177875aeeec1ac (diff)
- fix for View mode frame;
- many unneeded spaces removed git-svn-id: http://svn.miranda-ng.org/main/trunk@893 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/modern_tbbutton.cpp')
-rw-r--r--plugins/Clist_modern/modern_tbbutton.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/plugins/Clist_modern/modern_tbbutton.cpp b/plugins/Clist_modern/modern_tbbutton.cpp
index 8421785765..bb3169294f 100644
--- a/plugins/Clist_modern/modern_tbbutton.cpp
+++ b/plugins/Clist_modern/modern_tbbutton.cpp
@@ -294,7 +294,7 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam
return 1;
case WM_CAPTURECHANGED:
- if ( (HWND)lParam != lpSBData->hwnd && lpSBData->stateId != PBS_DISABLED) {
+ if ((HWND)lParam != lpSBData->hwnd && lpSBData->stateId != PBS_DISABLED) {
// don't change states if disabled
lpSBData->stateId = PBS_NORMAL;
InvalidateParentRect(lpSBData->hwnd, NULL, TRUE);
@@ -303,8 +303,8 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam
case WM_LBUTTONDOWN:
{
- int xPos = ( ( int )( short ) LOWORD( lParam ));
- int yPos = ( ( int )( short ) HIWORD( lParam ));
+ int xPos = (( int )( short ) LOWORD( lParam ));
+ int yPos = (( int )( short ) HIWORD( lParam ));
POINT ptMouse = { xPos, yPos };
RECT rcClient;
@@ -526,13 +526,8 @@ static LRESULT BroadCastMessageToChild(HWND hwnd, int message, WPARAM wParam, LP
return 1;
}
-static void CustomizeButton(HANDLE ttbid, HWND hWnd, LPARAM lParam)
+void MakeButtonSkinned(HWND hWnd)
{
- if (ttbid == TTB_WINDOW_HANDLE) {
- CustomizeToolbar(hWnd);
- return;
- }
-
MButtonCustomize Custom;
Custom.cbLen = sizeof(TBBUTTONDATA);
Custom.fnPainter = (pfnPainterFunc)PaintWorker;
@@ -540,12 +535,23 @@ static void CustomizeButton(HANDLE ttbid, HWND hWnd, LPARAM lParam)
SendMessage(hWnd, BUTTONSETCUSTOM, 0, (LPARAM)&Custom);
TBBUTTONDATA* p = (TBBUTTONDATA*)GetWindowLongPtr(hWnd, 0);
- sprintf(p->szButtonID, "Toolbar.%p", p->hwnd);
p->nFontID = -1;
p->hThemeButton = xpt_AddThemeHandle(p->hwnd, L"BUTTON");
p->hThemeToolbar = xpt_AddThemeHandle(p->hwnd, L"TOOLBAR");
WindowList_Add(hButtonWindowList, hWnd, NULL);
+}
+
+static void CustomizeButton(HANDLE ttbid, HWND hWnd, LPARAM lParam)
+{
+ if (ttbid == TTB_WINDOW_HANDLE) {
+ CustomizeToolbar(hWnd);
+ return;
+ }
+
+ MakeButtonSkinned(hWnd);
+ TBBUTTONDATA* p = (TBBUTTONDATA*)GetWindowLongPtr(hWnd, 0);
+ sprintf(p->szButtonID, "Toolbar.%p", p->hwnd);
SendMessage(hWnd, MBM_UPDATETRANSPARENTFLAG, 0, 2);
}