summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_toolbar.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-26 16:32:28 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-26 16:32:28 +0000
commitdbbf4f80b0774a3880989458cd1519e29e959f54 (patch)
tree69753799eea12c7bf676d7b6e79b76f15f36f638 /plugins/Clist_modern/src/modern_toolbar.cpp
parent7e157d2364e6e23d523c5712b661a994d566ea5a (diff)
fix for toolbar's background drawing
git-svn-id: http://svn.miranda-ng.org/main/trunk@7909 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_toolbar.cpp')
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp
index e5d79e65f6..80c7d474b0 100644
--- a/plugins/Clist_modern/src/modern_toolbar.cpp
+++ b/plugins/Clist_modern/src/modern_toolbar.cpp
@@ -134,6 +134,28 @@ static int ehhToolBarSettingsChanged(WPARAM wParam, LPARAM lParam)
return 0;
}
+static int ehhToolBarBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
+{
+ if (tbdat.mtb_hBmpBackground) {
+ DeleteObject(tbdat.mtb_hBmpBackground);
+ tbdat.mtb_hBmpBackground = NULL;
+ }
+ if (g_CluiData.fDisableSkinEngine) {
+ DBVARIANT dbv;
+ tbdat.mtb_bkColour = sttGetColor("ToolBar", "BkColour", CLCDEFAULT_BKCOLOUR);
+ if (db_get_b(NULL, "ToolBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
+ if (!db_get_s(NULL, "ToolBar", "BkBitmap", &dbv, DBVT_TCHAR)) {
+ tbdat.mtb_hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.ptszVal);
+ db_free(&dbv);
+ }
+ }
+ tbdat.mtb_useWinColors = db_get_b(NULL, "ToolBar", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
+ tbdat.mtb_backgroundBmpUse = db_get_b(NULL, "ToolBar", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
+ }
+ PostMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ return 0;
+}
+
static BOOL sttDrawToolBarBackground(HWND hwnd, HDC hdc, RECT *rect, ModernToolbarCtrl* pMTBInfo)
{
BOOL bFloat = (GetParent(hwnd)!=pcli->hwndContactList);
@@ -147,9 +169,11 @@ static BOOL sttDrawToolBarBackground(HWND hwnd, HDC hdc, RECT *rect, ModernToolb
GetClientRect(hwnd,&rc);
if (!(tbdat.mtb_backgroundBmpUse && tbdat.mtb_hBmpBackground) && tbdat.mtb_useWinColors) {
+ HRESULT hr = S_FALSE;
if (xpt_IsThemed(pMTBInfo->mtbXPTheme))
- xpt_DrawTheme(pMTBInfo->mtbXPTheme, pMTBInfo->hWnd, hdc, 0, 0, &rc, &rc);
- else {
+ hr = xpt_DrawTheme(pMTBInfo->mtbXPTheme, pMTBInfo->hWnd, hdc, 0, 0, &rc, &rc);
+
+ if (hr == S_FALSE) {
hbr = GetSysColorBrush(COLOR_3DFACE);
FillRect(hdc, &rc, hbr);
}
@@ -337,6 +361,7 @@ static int Toolbar_ModulesLoaded(WPARAM, LPARAM)
HRESULT ToolbarLoadModule()
{
+ HookEvent(ME_BACKGROUNDCONFIG_CHANGED, ehhToolBarBackgroundSettingsChanged);
HookEvent(ME_SYSTEM_MODULELOAD, Toolbar_ModuleReloaded);
HookEvent(ME_SYSTEM_MODULESLOADED, Toolbar_ModulesLoaded);
return S_OK;