summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Clist_modern/src/modern_tbbutton.cpp2
-rw-r--r--plugins/TopToolBar/toolbar.cpp40
2 files changed, 22 insertions, 20 deletions
diff --git a/plugins/Clist_modern/src/modern_tbbutton.cpp b/plugins/Clist_modern/src/modern_tbbutton.cpp
index 9d0402324e..ce37acb5ae 100644
--- a/plugins/Clist_modern/src/modern_tbbutton.cpp
+++ b/plugins/Clist_modern/src/modern_tbbutton.cpp
@@ -423,7 +423,7 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam
case MBM_REFRESHICOLIBICON:
if (bct->hIcolibHandle)
- bct->hIcon = (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0 , (LPARAM) bct->hIcolibHandle);
+ bct->hIcon = Skin_GetIconByHandle(bct->hIcolibHandle);
else
bct->hIcon = NULL;
InvalidateRect(hwndDlg,NULL,TRUE);
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;
}