summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_tbbutton.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-23 18:49:38 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-23 18:49:38 +0000
commitbddc04b139e8dfb3ecfb37af1fbf32965b15c577 (patch)
tree5959751dbeb4a4d48ba4b813b900cc0967212aaa /plugins/Clist_modern/src/modern_tbbutton.cpp
parent38d3bebef0df2e5fb6da91a4fb9a209a609e0e79 (diff)
partially fixes #188 (When state of 2-state button is changed from diferent place (like disable/enable popups through Main menu), then icon isn't changed until toptoolbar is hovered by mouse)
git-svn-id: http://svn.miranda-ng.org/main/trunk@7841 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_tbbutton.cpp')
-rw-r--r--plugins/Clist_modern/src/modern_tbbutton.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/plugins/Clist_modern/src/modern_tbbutton.cpp b/plugins/Clist_modern/src/modern_tbbutton.cpp
index d9f4fd9e47..8efe3f1b16 100644
--- a/plugins/Clist_modern/src/modern_tbbutton.cpp
+++ b/plugins/Clist_modern/src/modern_tbbutton.cpp
@@ -418,26 +418,28 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam
bct->hIcon = Skin_GetIconByHandle(bct->hIcolibHandle);
else
bct->hIcon = NULL;
- InvalidateRect(hwndDlg,NULL,TRUE);
- pcli->pfnInvalidateRect(GetParent(GetParent(hwndDlg)),NULL,TRUE);
+ InvalidateRect(hwndDlg, NULL, TRUE);
+ pcli->pfnInvalidateRect(GetParent(GetParent(hwndDlg)), NULL, TRUE);
return 1;
case MBM_UPDATETRANSPARENTFLAG:
- {
- LONG flag = GetWindowLongPtr(hwndDlg,GWL_EXSTYLE);
- LONG oldFlag = flag;
- if (lParam == 2)
- lParam = (g_CluiData.fDisableSkinEngine)?0:1;
- flag &= ~WS_EX_TRANSPARENT;
- if (lParam) flag |= WS_EX_TRANSPARENT;
- if (flag != oldFlag) {
- SetWindowLongPtr(hwndDlg,GWL_EXSTYLE,flag);
- RedrawWindow(hwndDlg,NULL,NULL,RDW_INVALIDATE|RDW_UPDATENOW);
- }
+ LONG flag = GetWindowLongPtr(hwndDlg, GWL_EXSTYLE);
+ LONG oldFlag = flag;
+ if (lParam == 2)
+ lParam = (g_CluiData.fDisableSkinEngine) ? 0 : 1;
+ flag &= ~WS_EX_TRANSPARENT;
+ if (lParam) flag |= WS_EX_TRANSPARENT;
+ if (flag != oldFlag) {
+ SetWindowLongPtr(hwndDlg, GWL_EXSTYLE, flag);
+ RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
}
return 1;
}
- return mir_callNextSubclass(hwndDlg, ToolbarButtonProc, msg, wParam, lParam);
+
+ LRESULT res = mir_callNextSubclass(hwndDlg, ToolbarButtonProc, msg, wParam, lParam);
+ if (msg == BM_SETIMAGE)
+ InvalidateParentRect(hwndDlg, NULL, TRUE);
+ return res;
}
void MakeButtonSkinned(HWND hWnd)