summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-09-27 19:35:36 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-09-27 19:35:36 +0000
commitc23145643c47428677da6a42f3185b94968fddf1 (patch)
tree12a03568f3b2f0ce8f2756801c9b781dd4df978a /plugins
parentc94b07138f148a4ee92313e8a57e5725d51fe1b4 (diff)
clutch for TopToolBar not to destroy buttons on Apply in options
git-svn-id: http://svn.miranda-ng.org/main/trunk@1691 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp6
-rw-r--r--plugins/Clist_nicer/src/cluiservices.cpp36
-rw-r--r--plugins/ExternalAPI/m_toptoolbar.h1
-rw-r--r--plugins/TopToolBar/src/ttbopt.cpp7
4 files changed, 26 insertions, 24 deletions
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp
index ce407edc96..0390e39949 100644
--- a/plugins/Clist_modern/src/modern_toolbar.cpp
+++ b/plugins/Clist_modern/src/modern_toolbar.cpp
@@ -100,11 +100,6 @@ struct ModernToolbarCtrl : public TTBCtrl
XPTHANDLE mtbXPTheme;
};
-struct MTB_BUTTONINFO
-{
- HWND hWindow;
-};
-
struct
{
HBITMAP mtb_hBmpBackground;
@@ -304,6 +299,7 @@ void CustomizeToolbar(HWND hwnd)
CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)hwnd,(LPARAM)ToolBar_LayeredPaintProc);
pMTBInfo->mtbXPTheme = xpt_AddThemeHandle(hwnd, L"TOOLBAR");
+ pMTBInfo->bHardUpdate = TRUE;
}
#define TTB_OPTDIR "TopToolBar"
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp
index d5cba25d3d..9572935020 100644
--- a/plugins/Clist_nicer/src/cluiservices.cpp
+++ b/plugins/Clist_nicer/src/cluiservices.cpp
@@ -240,26 +240,28 @@ void CluiProtocolStatusChanged( int parStatus, const char* szProto )
* status mode button
*/
- if (szStatus) {
- if (pcli->hwndContactList && IsWindow(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS))) {
- HWND hwndTtbStatus = ClcGetButtonWindow(IDC_TBTOPSTATUS);
-
- SendMessage(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS), WM_SETTEXT, 0, (LPARAM) szStatus);
- if (!hIcon) {
- SendMessage(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS), BUTTONSETIMLICON, (WPARAM) hCListImages, (LPARAM) iIcon);
- if (g_ButtonItems == NULL && hwndTtbStatus)
- SendMessage( hwndTtbStatus, BUTTONSETIMLICON, (WPARAM) hCListImages, (LPARAM) iIcon);
- }
- else {
- SendMessage(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS), BM_SETIMAGE, IMAGE_ICON, (LPARAM) hIcon);
- if (g_ButtonItems == NULL && hwndTtbStatus)
+ if (szStatus && pcli->hwndContactList) {
+ HWND hwndClistBtn = GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS);
+ if ( IsWindow(hwndClistBtn)) {
+ SendMessage(hwndClistBtn, WM_SETTEXT, 0, (LPARAM) szStatus);
+ if (!hIcon)
+ SendMessage(hwndClistBtn, BUTTONSETIMLICON, (WPARAM) hCListImages, (LPARAM) iIcon);
+ else
+ SendMessage(hwndClistBtn, BM_SETIMAGE, IMAGE_ICON, (LPARAM) hIcon);
+ InvalidateRect(hwndClistBtn, NULL, TRUE);
+ }
+
+ HWND hwndTtbStatus = ClcGetButtonWindow(IDC_TBTOPSTATUS);
+ if ( IsWindow(hwndTtbStatus)) {
+ if (g_ButtonItems == NULL) {
+ if (!hIcon)
+ SendMessage(hwndTtbStatus, BUTTONSETIMLICON, (WPARAM) hCListImages, (LPARAM) iIcon);
+ else
SendMessage(hwndTtbStatus, BM_SETIMAGE, IMAGE_ICON, (LPARAM) hIcon);
}
- InvalidateRect(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS), NULL, TRUE);
- if (hwndTtbStatus)
- InvalidateRect(hwndTtbStatus, NULL, TRUE);
- SFL_Update(hIcon, iIcon, hCListImages, szStatus, TRUE);
+ InvalidateRect(hwndTtbStatus, NULL, TRUE);
}
+ SFL_Update(hIcon, iIcon, hCListImages, szStatus, TRUE);
}
return;
}
diff --git a/plugins/ExternalAPI/m_toptoolbar.h b/plugins/ExternalAPI/m_toptoolbar.h
index ee3e1d0038..3c9d569d31 100644
--- a/plugins/ExternalAPI/m_toptoolbar.h
+++ b/plugins/ExternalAPI/m_toptoolbar.h
@@ -165,6 +165,7 @@ struct TTBCtrl
int nLastHeight; // fix against recursion in WM_SIZE
BOOL bOrderChanged; // set by buttons' arrange procedure if the buttons' order was changed
BOOL bFlatButtons, bAutoSize, bSingleLine;
+ BOOL bHardUpdate; // clist modern requires to delete buttons to update them
SortedList* pButtonList;
diff --git a/plugins/TopToolBar/src/ttbopt.cpp b/plugins/TopToolBar/src/ttbopt.cpp
index db7d78dcb5..ea6e994cba 100644
--- a/plugins/TopToolBar/src/ttbopt.cpp
+++ b/plugins/TopToolBar/src/ttbopt.cpp
@@ -131,8 +131,11 @@ static void RecreateWindows()
for (int i = 0; i < Buttons.getCount(); i++) {
TopButtonInt *b = Buttons[i];
if (b->hwnd) {
- DestroyWindow(b->hwnd);
- b->CreateWnd();
+ if (g_ctrl->bHardUpdate) {
+ DestroyWindow(b->hwnd);
+ b->CreateWnd();
+ }
+ else b->SetBitmap();
}
}
}