summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2015-03-07 07:58:11 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2015-03-07 07:58:11 +0000
commit4b7a566431243b3378db9fad866015d82088dce6 (patch)
tree64058ee55e8f47f4564ce2ac7c99bcd462dcba70 /plugins/Clist_modern
parent72fee5431ff14fff8be1280bf3d75026e6a644d9 (diff)
rev. 12363 broke clist_modern skin loading, therefore is temporary reverted
git-svn-id: http://svn.miranda-ng.org/main/trunk@12366 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/modern_aniavatars.cpp5
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp20
-rw-r--r--plugins/Clist_modern/src/modern_gettextasync.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp110
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_statusbar_options.cpp6
8 files changed, 97 insertions, 54 deletions
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp
index dea41dab1c..3f27ffccec 100644
--- a/plugins/Clist_modern/src/modern_aniavatars.cpp
+++ b/plugins/Clist_modern/src/modern_aniavatars.cpp
@@ -847,7 +847,10 @@ int AniAva_RedrawAllAvatars(BOOL updateZOrder)
updateZOrder = 1;
for (int i = 0; i < s_Objects.getCount(); i++) {
ANIAVA_OBJECT &pai = s_Objects[i];
- SendMessage(pai.hWindow, AAM_REDRAW, (WPARAM)updateZOrder, 0);
+ if (updateZOrder)
+ SendMessage(pai.hWindow, AAM_REDRAW, (WPARAM)updateZOrder, 0);
+ else
+ SendNotifyMessage(pai.hWindow, AAM_REDRAW, (WPARAM)updateZOrder, 0);
}
return 1;
}
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index 4c3f912345..b7d0142d1b 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -438,7 +438,7 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar
tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvi.hItem = hti.hItem;
TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
- tvi.iImage = tvi.iSelectedImage = !tvi.iImage;
+ tvi.iImage = tvi.iSelectedImage = tvi.iImage = !tvi.iImage;
TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
}
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp
index 0c119af79c..83f8fcedb0 100644
--- a/plugins/Clist_modern/src/modern_clcpaint.cpp
+++ b/plugins/Clist_modern/src/modern_clcpaint.cpp
@@ -566,7 +566,7 @@ MODERNMASK *CLCPaint::_GetCLCContactRowBackModernMask(ClcGroup *group, ClcContac
switch (Drawing->type) {
case CLCIT_GROUP:
_AddParamShort(mpModernMask, hi_Type, hi_Group);
- _AddParamShort(mpModernMask, hi_Open, (Drawing->group && Drawing->group->expanded) ? hi_True : hi_False);
+ _AddParamShort(mpModernMask, hi_Open, (Drawing && Drawing->group && Drawing->group->expanded) ? hi_True : hi_False);
_AddParamShort(mpModernMask, hi_IsEmpty, (Drawing->group->cl.count == 0) ? hi_True : hi_False);
break;
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 4aa216fa8d..eb1551cfa8 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -1171,8 +1171,8 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state)
HDC hdcBmp = CreateCompatibleDC(hdc);
HBITMAP oldbm = (HBITMAP)SelectObject(hdcBmp, dat->hMenuBackground);
int y = clRect.top, x = clRect.left, destw, desth;
- int maxx = (dat->MenuBmpUse & CLBF_TILEH) ? r1.right : x + 1;
- int maxy = (dat->MenuBmpUse & CLBF_TILEV) ? r1.bottom : y + 1;
+ int maxx = (dat->MenuBmpUse & CLBF_TILEH) ? maxx = r1.right : x + 1;
+ int maxy = (dat->MenuBmpUse & CLBF_TILEV) ? maxy = r1.bottom : y + 1;
switch (dat->MenuBmpUse & CLBM_TYPE) {
case CLB_STRETCH:
@@ -1726,7 +1726,8 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam)
else if (msg == WM_WINDOWPOSCHANGING) {
// Snaping if it is not in LayeredMode
- WINDOWPOS *wp = (WINDOWPOS *)lParam;
+ WINDOWPOS * wp;
+ wp = (WINDOWPOS *)lParam;
CLUI::SnappingToEdge(wp);
return DefWindowProc(m_hWnd, msg, wParam, lParam);
}
@@ -1828,6 +1829,14 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam)
SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
}
return TRUE;
+
+ case WM_WINDOWPOSCHANGING:
+ WINDOWPOS *wp = (WINDOWPOS *)lParam;
+ if (wp->flags&SWP_HIDEWINDOW && mutex_bAnimationInProgress)
+ return 0;
+ if (g_CluiData.fOnDesktop)
+ wp->flags |= SWP_NOACTIVATE | SWP_NOZORDER;
+ return DefWindowProc(m_hWnd, msg, wParam, lParam);
}
return 0;
}
@@ -2410,7 +2419,10 @@ LRESULT CLUI::OnListSizeChangeNotify(NMCLISTCONTROL * pnmc)
}
else bNeedFixSizingRect = 0;
- SetWindowPos(m_hWnd, 0, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, SWP_NOZORDER | SWP_NOACTIVATE);
+ if (!mutex_bDuringSizing)
+ SetWindowPos(m_hWnd, 0, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, SWP_NOZORDER | SWP_NOACTIVATE);
+ else
+ SetWindowPos(m_hWnd, 0, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, SWP_NOZORDER | SWP_NOACTIVATE);
nRequiredHeight = 0;
diff --git a/plugins/Clist_modern/src/modern_gettextasync.cpp b/plugins/Clist_modern/src/modern_gettextasync.cpp
index b9bb6cdb72..11d1c64bcf 100644
--- a/plugins/Clist_modern/src/modern_gettextasync.cpp
+++ b/plugins/Clist_modern/src/modern_gettextasync.cpp
@@ -87,7 +87,7 @@ static void gtaThreadProc(void*)
break;
SHORTDATA *dat;
- if (mpChain.dat == NULL || (!IsBadReadPtr(mpChain.dat, sizeof(*mpChain.dat)) && mpChain.dat->hWnd == data.hWnd))
+ if (mpChain.dat == NULL || (!IsBadReadPtr(mpChain.dat, sizeof(mpChain.dat)) && mpChain.dat->hWnd == data.hWnd))
dat = &data;
else {
Sync(CLUI_SyncGetShortData, (WPARAM)mpChain.dat->hWnd, (LPARAM)&dat2);
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp
index da509b61a1..9eab051c74 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -190,9 +190,10 @@ int IniParser::GetSkinFolder(IN const TCHAR * szFileName, OUT TCHAR * pszFolderN
*pszPos = _T('\0');
_tcscpy(pszFolderName, szBuff);
- TCHAR custom_folder[MAX_PATH], cus[MAX_PATH];
+ TCHAR custom_folder[MAX_PATH];
+ TCHAR cus[MAX_PATH];
TCHAR *b3;
- _tcsncpy(custom_folder, pszFolderName, MAX_PATH -1);
+ _tcscpy(custom_folder, pszFolderName);
b3 = custom_folder + _tcslen(custom_folder);
while (b3 > custom_folder && *b3 != _T('\\')) { b3--; }
*b3 = _T('\0');
@@ -532,12 +533,15 @@ int ske_ReleaseBufferDC(HDC hDC, int keepTime)
BOOL ske_SetRgnOpaque(HDC memdc, HRGN hrgn, BOOL force)
{
+ RGNDATA * rdata;
+ DWORD rgnsz;
DWORD d;
+ RECT *rect;
if (g_CluiData.fDisableSkinEngine && !force) return TRUE;
- DWORD rgnsz = GetRegionData(hrgn, 0, NULL);
- RGNDATA *rdata = (RGNDATA *)mir_alloc(rgnsz);
+ rgnsz = GetRegionData(hrgn, 0, NULL);
+ rdata = (RGNDATA *)mir_alloc(rgnsz);
GetRegionData(hrgn, rgnsz, rdata);
- RECT *rect = (RECT *)rdata->Buffer;
+ rect = (RECT *)rdata->Buffer;
for (d = 0; d < rdata->rdh.nCount; d++) {
ske_SetRectOpaque(memdc, &rect[d], force);
}
@@ -551,11 +555,12 @@ BOOL ske_SetRectOpaque(HDC memdc, RECT *fr, BOOL force)
int f = 0;
BYTE * bits;
BITMAP bmp;
+ HBITMAP hbmp;
if (g_CluiData.fDisableSkinEngine && !force)
return TRUE;
- HBITMAP hbmp = (HBITMAP)GetCurrentObject(memdc, OBJ_BITMAP);
+ hbmp = (HBITMAP)GetCurrentObject(memdc, OBJ_BITMAP);
GetObject(hbmp, sizeof(bmp), &bmp);
if (bmp.bmPlanes != 1)
@@ -637,13 +642,15 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
return 1;
}
else if (mode == FM_TILE_VERT && (rGlyph->bottom - rGlyph->top > 0) && (rGlyph->right - rGlyph->left > 0)) {
+ HDC mem2dc;
+ HBITMAP mem2bmp, oldbmp;
RECT wr;
IntersectRect(&wr, rClip, rFill);
if ((wr.bottom - wr.top)*(wr.right - wr.left) == 0) return 0;
- HDC mem2dc = CreateCompatibleDC(hDest);
+ mem2dc = CreateCompatibleDC(hDest);
//SetStretchBltMode(mem2dc, HALFTONE);
- HBITMAP mem2bmp = ske_CreateDIB32(wr.right - wr.left, rGlyph->bottom - rGlyph->top);
- HBITMAP oldbmp = (HBITMAP)SelectObject(mem2dc, mem2bmp);
+ mem2bmp = ske_CreateDIB32(wr.right - wr.left, rGlyph->bottom - rGlyph->top);
+ oldbmp = (HBITMAP)SelectObject(mem2dc, mem2bmp);
if (!oldbmp)
return 0;
@@ -723,16 +730,18 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
DeleteDC(mem2dc);
}
else if (mode == FM_TILE_HORZ && (rGlyph->right - rGlyph->left > 0) && (rGlyph->bottom - rGlyph->top > 0) && (rFill->bottom - rFill->top) > 0 && (rFill->right - rFill->left) > 0) {
+ HDC mem2dc;
RECT wr;
+ HBITMAP mem2bmp, oldbmp;
int w = rGlyph->right - rGlyph->left;
int h = rFill->bottom - rFill->top;
IntersectRect(&wr, rClip, rFill);
if ((wr.bottom - wr.top)*(wr.right - wr.left) == 0) return 0;
h = wr.bottom - wr.top;
- HDC mem2dc = CreateCompatibleDC(hDest);
+ mem2dc = CreateCompatibleDC(hDest);
- HBITMAP mem2bmp = ske_CreateDIB32(w, h);
- HBITMAP oldbmp = (HBITMAP)SelectObject(mem2dc, mem2bmp);
+ mem2bmp = ske_CreateDIB32(w, h);
+ oldbmp = (HBITMAP)SelectObject(mem2dc, mem2bmp);
if (!oldbmp)
return 0;
@@ -748,7 +757,8 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
if (drawMode == 0 || drawMode == 2) {
if (drawMode == 0) {
- int dx = (wr.left - rFill->left) % w;
+ int dx;
+ dx = (wr.left - rFill->left) % w;
if (dx >= 0) {
int wt;
x = wr.left;
@@ -764,7 +774,8 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
BitBlt(hDest, x, wr.top, wr.right - x, h, mem2dc, 0, 0, SRCCOPY);
}
else {
- int dx = (wr.left - rFill->left) % w;
+ int dx;
+ dx = (wr.left - rFill->left) % w;
x = wr.left - dx;
while (x < wr.right - w) {
ske_AlphaBlend(hDest, x, wr.top, w, h, mem2dc, 0, 0, w, h, bf);
@@ -777,7 +788,8 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
}
else {
BLENDFUNCTION bf = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
- int dx = (wr.left - rFill->left) % w;
+ int dx;
+ dx = (wr.left - rFill->left) % w;
if (dx >= 0) {
int wt;
x = wr.left;
@@ -800,16 +812,18 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
DeleteDC(mem2dc);
}
else if (mode == FM_TILE_BOTH && (rGlyph->right - rGlyph->left > 0) && (rGlyph->bottom - rGlyph->top > 0)) {
+ HDC mem2dc;
int w = rGlyph->right - rGlyph->left;
- int x = 0;
+ int x = 0;
int h = rFill->bottom - rFill->top;
+ HBITMAP mem2bmp, oldbmp;
RECT wr;
IntersectRect(&wr, rClip, rFill);
if ((wr.bottom - wr.top)*(wr.right - wr.left) == 0) return 0;
- HDC mem2dc = CreateCompatibleDC(hDest);
- HBITMAP mem2bmp = ske_CreateDIB32(w, wr.bottom - wr.top);
+ mem2dc = CreateCompatibleDC(hDest);
+ mem2bmp = ske_CreateDIB32(w, wr.bottom - wr.top);
h = wr.bottom - wr.top;
- HBITMAP oldbmp = (HBITMAP)SelectObject(mem2dc, mem2bmp);
+ oldbmp = (HBITMAP)SelectObject(mem2dc, mem2bmp);
#ifdef _DEBUG
if (!oldbmp)
(NULL, "Tile bitmap not selected", "ERROR", MB_OK);
@@ -819,8 +833,10 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
//fill temp bitmap
{
- int dy = (wr.top - rFill->top) % (rGlyph->bottom - rGlyph->top);
- int y = -dy;
+ int y;
+ int dy;
+ dy = (wr.top - rFill->top) % (rGlyph->bottom - rGlyph->top);
+ y = -dy;
while (y < wr.bottom - wr.top) {
ske_AlphaBlend(mem2dc, 0, y, w, rGlyph->bottom - rGlyph->top, hSource, rGlyph->left, rGlyph->top, w, rGlyph->bottom - rGlyph->top, bf);
@@ -831,7 +847,9 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
//end temp bitmap
if (drawMode == 0 || drawMode == 2) {
if (drawMode == 0) {
- int dx = (wr.left - rFill->left) % w;
+
+ int dx;
+ dx = (wr.left - rFill->left) % w;
if (dx >= 0) {
int wt;
x = wr.left;
@@ -847,7 +865,8 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
BitBlt(hDest, x, wr.top, wr.right - x, h, mem2dc, 0, 0, SRCCOPY);
}
else {
- int dx = (wr.left - rFill->left) % w;
+ int dx;
+ dx = (wr.left - rFill->left) % w;
x = wr.left - dx;
while (x < wr.right - w) {
ske_AlphaBlend(hDest, x, wr.top, w, h, mem2dc, 0, 0, w, h, bf);
@@ -861,7 +880,8 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
else {
BLENDFUNCTION bf = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
- int dx = (wr.left - rFill->left) % w;
+ int dx;
+ dx = (wr.left - rFill->left) % w;
if (dx >= 0) {
int wt;
x = wr.left;
@@ -893,7 +913,7 @@ HBITMAP ske_CreateDIB32(int cx, int cy)
return ske_CreateDIB32Point(cx, cy, NULL);
}
-HBITMAP ske_CreateDIB32Point(int cx, int cy, void **bits)
+HBITMAP ske_CreateDIB32Point(int cx, int cy, void ** bits)
{
if (cx < 0 || cy < 0)
return NULL;
@@ -908,7 +928,7 @@ HBITMAP ske_CreateDIB32Point(int cx, int cy, void **bits)
UINT *ptPixels;
HBITMAP DirectBitmap = CreateDIBSection(NULL,
- &RGB32BitsBITMAPINFO,
+ (BITMAPINFO *)&RGB32BitsBITMAPINFO,
DIB_RGB_COLORS,
(void **)&ptPixels,
NULL, 0);
@@ -1328,6 +1348,7 @@ int ske_AddDescriptorToSkinObjectList(LPSKINOBJECTDESCRIPTOR lpDescr, SKINOBJECT
{
SKINOBJECTSLIST *sk;
if (Skin) sk = Skin; else sk = &g_SkinObjectList;
+ if (!sk) return 0;
if (mir_bool_strcmpi(lpDescr->szObjectID, "_HEADER_")) return 0;
{//check if new object allready presents.
DWORD i = 0;
@@ -1730,11 +1751,13 @@ static HBITMAP ske_LoadGlyphImageByDecoders(const TCHAR *tszFileName)
if (bmpInfo.bmBitsPixel == 32)
ske_PreMultiplyChanells(hBitmap, f);
else {
- HDC dc32 = CreateCompatibleDC(NULL);
- HDC dc24 = CreateCompatibleDC(NULL);
- HBITMAP hBitmap32 = ske_CreateDIB32(bmpInfo.bmWidth, bmpInfo.bmHeight);
- HBITMAP obmp24 = (HBITMAP)SelectObject(dc24, hBitmap);
- HBITMAP obmp32 = (HBITMAP)SelectObject(dc32, hBitmap32);
+ HDC dc24, dc32;
+ HBITMAP hBitmap32, obmp24, obmp32;
+ dc32 = CreateCompatibleDC(NULL);
+ dc24 = CreateCompatibleDC(NULL);
+ hBitmap32 = ske_CreateDIB32(bmpInfo.bmWidth, bmpInfo.bmHeight);
+ obmp24 = (HBITMAP)SelectObject(dc24, hBitmap);
+ obmp32 = (HBITMAP)SelectObject(dc32, hBitmap32);
BitBlt(dc32, 0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight, dc24, 0, 0, SRCCOPY);
SelectObject(dc24, obmp24);
SelectObject(dc32, obmp32);
@@ -1764,15 +1787,15 @@ HBITMAP ske_LoadGlyphImage(const TCHAR *tszFileName)
mir_cslock lck(cs_SkinChanging);
- if (!pLoadedImages)
- return NULL;
-
- for (DWORD i = 0; i < dwLoadedImagesCount; i++) {
- if (mir_bool_tstrcmpi(pLoadedImages[i].szFileName, szFile)) {
- pLoadedImages[i].dwLoadedTimes++;
- return pLoadedImages[i].hGlyph;
+ if (pLoadedImages) {
+ for (DWORD i = 0; i < dwLoadedImagesCount; i++) {
+ if (mir_bool_tstrcmpi(pLoadedImages[i].szFileName, szFile)) {
+ pLoadedImages[i].dwLoadedTimes++;
+ return pLoadedImages[i].hGlyph;
+ }
}
}
+
// load new image
HBITMAP hbmp = ske_skinLoadGlyphImage(szFile);
if (hbmp == NULL)
@@ -1942,9 +1965,11 @@ static void ske_LinkSkinObjects(SKINOBJECTSLIST * pObjectList)
int i;
// LINK Text with objects
for (i = 0; i < pObjectList->pTextList->realCount; i++) {
+ GLYPHTEXT * glText;
GLYPHOBJECT *globj = NULL;
- GLYPHTEXT *glText = (GLYPHTEXT *)pObjectList->pTextList->items[i];
- SKINOBJECTDESCRIPTOR *lpobj = ske_FindObjectByName(glText->szObjectName, OT_GLYPHOBJECT, pObjectList);
+ SKINOBJECTDESCRIPTOR * lpobj;
+ glText = (GLYPHTEXT *)pObjectList->pTextList->items[i];
+ lpobj = ske_FindObjectByName(glText->szObjectName, OT_GLYPHOBJECT, pObjectList);
mir_free_and_nil(glText->szObjectName);
if (lpobj)
globj = (GLYPHOBJECT*)lpobj->Data;
@@ -2992,7 +3017,10 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting)
}
// copy image at hdc
- BitBlt(hdc, x1, y1, w1, h1, g_pCachedWindow->hBackDC, x + x1, y + y1, SRCCOPY);
+ if (SkipBkgBlitting) //image already at foreground
+ BitBlt(hdc, x1, y1, w1, h1, g_pCachedWindow->hImageDC, x + x1, y + y1, SRCCOPY);
+ else
+ BitBlt(hdc, x1, y1, w1, h1, g_pCachedWindow->hBackDC, x + x1, y + y1, SRCCOPY);
Frame->PaintCallbackProc(Frame->hWnd, hdc, &ru, Frame->UpdateRgn, Frame->dwFlags, Frame->PaintData);
}
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index 365b594c0a..dea40a5ba3 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -399,7 +399,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
p.fullWidth = w;
if (g_StatusBarData.sameWidth) {
ProtoWidth[i] = sw;
- SumWidth += sw;
+ SumWidth += w;
}
else {
ProtoWidth[i] = w;
@@ -854,7 +854,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
bool first = true;
for (int pos = 0; pos < protoCount; pos++) {
int i = pcli->pfnGetAccountIndexByPos(pos);
- if (i < 0 || i >= protoCount)
+ if (i < 0 && i >= protoCount)
continue;
char protoF[sizeof(g_CluiData.protoFilter)];
diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp
index 4ce81f27b6..358feda644 100644
--- a/plugins/Clist_modern/src/modern_statusbar_options.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp
@@ -126,9 +126,9 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg)
EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWXSTATUS), enableOptions && enableIcons);
if (!enableOptions) {
- EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWNORMAL), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWBOTH), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENTOVERLAY), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWNORMAL), enableOptions && enableIcons);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWBOTH), enableOptions && enableIcons);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENTOVERLAY), enableOptions && enableIcons);
}
EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWUNREADEMAIL), enableOptions);