diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-22 17:04:48 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-22 17:04:48 +0000 |
commit | c9df8df721df2993426e62bb1c17793e635a5e74 (patch) | |
tree | 796210889d9b1b33922d3d07c62b48756cc91389 /plugins | |
parent | e5c6bbad43b0343cbdfe189fd7596371aaf040a0 (diff) |
fix for icolib icons in TTB
git-svn-id: http://svn.miranda-ng.org/main/trunk@531 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/TopToolBar/toolbar.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/plugins/TopToolBar/toolbar.cpp b/plugins/TopToolBar/toolbar.cpp index 3daa11df5f..4e06728839 100644 --- a/plugins/TopToolBar/toolbar.cpp +++ b/plugins/TopToolBar/toolbar.cpp @@ -282,14 +282,10 @@ INT_PTR TTBAddButton(WPARAM wParam, LPARAM lParam) b->dwFlags = but->dwFlags;
- if (b->dwFlags & TTBBF_ICONBYHANDLE) {
- char buf[256];
- sprintf(buf, "%s_dn", b->name);
- b->hIconDn = LoadIconFromLibrary(buf, Skin_GetIconByHandle(but->hIconHandleDn), b->hIconHandleDn);
- sprintf(buf, "%s_up", b->name);
- b->hIconUp = LoadIconFromLibrary(buf, Skin_GetIconByHandle(but->hIconHandleUp), b->hIconHandleUp);
- }
- else b->hIconDn = but->hIconDn, b->hIconUp = but->hIconUp;
+ if (b->dwFlags & TTBBF_ICONBYHANDLE)
+ b->hIconDn = Skin_GetIconByHandle(but->hIconHandleDn), b->hIconUp = Skin_GetIconByHandle(but->hIconHandleUp);
+ else
+ b->hIconDn = but->hIconDn, b->hIconUp = but->hIconUp;
b->wParamUp = but->wParamUp;
b->lParamUp = but->lParamUp;
@@ -299,6 +295,11 @@ INT_PTR TTBAddButton(WPARAM wParam, LPARAM lParam) b->bPushed = (but->dwFlags & TTBBF_PUSHED) ? TRUE : FALSE;
if ( !(b->dwFlags & TTBBF_ISSEPARATOR)) {
+ char buf[256];
+ sprintf(buf, "%s_up", b->name);
+ b->hIconUp = LoadIconFromLibrary(buf, b->hIconUp, b->hIconHandleUp);
+ sprintf(buf, "%s_dn", b->name);
+ b->hIconDn = LoadIconFromLibrary(buf, b->hIconDn, b->hIconHandleDn);
}
b->LoadSettings();
@@ -603,10 +604,10 @@ static void PaintToolbar(HWND hwnd) GetObject(hBmpBackground, sizeof(bmp), &bmp);
hdcBmp = CreateCompatibleDC(hdcMem);
SelectObject(hdcBmp, hBmpBackground);
- y = backgroundBmpUse&CLBF_SCROLL?-yScroll:0;
- maxx = backgroundBmpUse&CLBF_TILEH?clRect.right:1;
- maxy = backgroundBmpUse&CLBF_TILEV?maxy = rcPaint->bottom:y+1;
- switch(backgroundBmpUse&CLBM_TYPE) {
+ y = backgroundBmpUse & CLBF_SCROLL ? -yScroll : 0;
+ maxx = backgroundBmpUse & CLBF_TILEH ? clRect.right : 1;
+ maxy = backgroundBmpUse & CLBF_TILEV ? maxy = rcPaint->bottom : y+1;
+ switch(backgroundBmpUse & CLBM_TYPE) {
case CLB_STRETCH:
if (backgroundBmpUse&CLBF_PROPORTIONAL) {
if (clRect.right*bmp.bmHeight<clRect.bottom*bmp.bmWidth) {
|