diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-23 12:53:10 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-23 12:53:10 +0000 |
commit | 201ace762530e0bec270301fd23f039af3872875 (patch) | |
tree | b8bbdad29aacf4e1f0ff77ce828ccf33088e9bec /plugins/TopToolBar | |
parent | bd80013253c1fabc856c05c4f839d00ec18b2b06 (diff) |
fix for the TTB OnIcoLibChange hook
git-svn-id: http://svn.miranda-ng.org/main/trunk@1120 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TopToolBar')
-rw-r--r-- | plugins/TopToolBar/toolbar.cpp | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/plugins/TopToolBar/toolbar.cpp b/plugins/TopToolBar/toolbar.cpp index 58b28040b9..156b83dbb7 100644 --- a/plugins/TopToolBar/toolbar.cpp +++ b/plugins/TopToolBar/toolbar.cpp @@ -25,13 +25,6 @@ int sortfunc(const TopButtonInt* a, const TopButtonInt* b) LIST<TopButtonInt> Buttons(8, sortfunc);
-static void SetAllBitmaps()
-{
- mir_cslock lck(csButtonsHook);
- for (int i = 0; i < Buttons.getCount(); i++)
- Buttons[i]->SetBitmap();
-}
-
TopButtonInt* idtopos(int id, int* pPos)
{
for ( int i = 0; i < Buttons.getCount(); i++)
@@ -523,20 +516,29 @@ INT_PTR TTBSetOptions(WPARAM wParam, LPARAM lParam) int OnIconChange(WPARAM wParam, LPARAM lParam)
{
- { mir_cslock lck(csButtonsHook);
- for (int i = 0; i < Buttons.getCount(); i++) {
- TopButtonInt* b = Buttons[i];
+ mir_cslock lck(csButtonsHook);
+ for (int i = 0; i < Buttons.getCount(); i++) {
+ TopButtonInt* b = Buttons[i];
+ if ( !b->hIconHandleUp && !b->hIconHandleDn)
+ continue;
+
+ if (b->hIconHandleUp) {
+ Skin_ReleaseIcon(b->hIconUp);
+ b->hIconUp = Skin_GetIconByHandle(b->hIconHandleUp);
+ }
+ if (b->hIconHandleDn) {
+ Skin_ReleaseIcon(b->hIconDn);
+ b->hIconDn = Skin_GetIconByHandle(b->hIconHandleDn);
+ }
+ DestroyWindow(b->hwnd);
+ b->CreateWnd();
+ }
- if (b->hIconHandleUp) {
- Skin_ReleaseIcon(b->hIconUp);
- b->hIconUp = Skin_GetIconByHandle(b->hIconHandleUp);
- }
- if (b->hIconHandleDn) {
- Skin_ReleaseIcon(b->hIconDn);
- b->hIconDn = Skin_GetIconByHandle(b->hIconHandleDn);
- } } }
+ if (g_ctrl->hWnd) {
+ g_ctrl->bOrderChanged = true;
+ PostMessage(g_ctrl->hWnd, TTB_UPDATEFRAMEVISIBILITY, TRUE, 0);
+ }
- SetAllBitmaps();
return 0;
}
|