diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-26 16:08:22 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-26 16:08:22 +0000 |
commit | df19fbdf4e4dac7dbcd6735472eb66efd02850e2 (patch) | |
tree | efac1f410db8eae5683ee988a968a7101f3dcfad /plugins/Clist_nicer | |
parent | 08fa43d58030952c48bcb2a7179e18579662c301 (diff) |
all clists to inherit the kernel settings loading code
git-svn-id: http://svn.miranda-ng.org/main/trunk@9948 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer')
-rw-r--r-- | plugins/Clist_nicer/src/clcutils.cpp | 61 |
1 files changed, 41 insertions, 20 deletions
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index 65cb2954a6..80bb802e79 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -544,9 +544,26 @@ void BeginRenameSelection(HWND hwnd, struct ClcData *dat) void LoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst)
{
- dat->bkChanged = 0;
+ HDC hdc = GetDC(hwnd);
+ for (int i = 0; i <= FONTID_MAX; i++) {
+ if (!dat->fontInfo[i].changed)
+ DeleteObject(dat->fontInfo[i].hFont);
- coreCli.pfnLoadClcOptions(hwnd, dat, bFirst);
+ LOGFONT lf;
+ pcli->pfnGetFontSetting(i, &lf, &dat->fontInfo[i].colour);
+ lf.lfHeight = -MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
+
+ dat->fontInfo[i].hFont = CreateFontIndirect(&lf);
+ dat->fontInfo[i].changed = 0;
+
+ HFONT holdfont = (HFONT)SelectObject(hdc, dat->fontInfo[i].hFont);
+ SIZE fontSize;
+ GetTextExtentPoint32(hdc, _T("x"), 1, &fontSize);
+ SelectObject(hdc, holdfont);
+
+ dat->fontInfo[i].fontHeight = fontSize.cy;
+ }
+ ReleaseDC(hwnd, hdc);
dat->min_row_heigh = (int)cfg::getByte("CLC","RowHeight",CLCDEFAULT_ROWHEIGHT);
dat->group_row_height = (int)cfg::getByte("CLC","GRowHeight",CLCDEFAULT_ROWHEIGHT);
@@ -554,27 +571,29 @@ void LoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst) dat->rightMargin = cfg::getByte("CLC", "RightMargin", CLCDEFAULT_LEFTMARGIN);
dat->bkColour = cfg::getByte("CLC", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS) ?
GetSysColor(COLOR_3DFACE) : cfg::getDword("CLC", "BkColour", CLCDEFAULT_BKCOLOUR);
- if ( !dat->bkChanged) {
- if (cfg::dat.hBrushCLCBk)
- DeleteObject(cfg::dat.hBrushCLCBk);
- cfg::dat.hBrushCLCBk = CreateSolidBrush(dat->bkColour);
- if (dat->hBmpBackground) {
- if (cfg::dat.hdcPic) {
- SelectObject(cfg::dat.hdcPic, cfg::dat.hbmPicOld);
- DeleteDC(cfg::dat.hdcPic);
- cfg::dat.hdcPic = 0;
- cfg::dat.hbmPicOld = 0;
- } }
- cfg::dat.bmpBackground = dat->hBmpBackground;
- if (cfg::dat.bmpBackground) {
- HDC hdcThis = GetDC(pcli->hwndContactList);
- GetObject(cfg::dat.bmpBackground, sizeof(cfg::dat.bminfoBg), &(cfg::dat.bminfoBg));
- cfg::dat.hdcPic = CreateCompatibleDC(hdcThis);
- cfg::dat.hbmPicOld = reinterpret_cast<HBITMAP>(SelectObject(cfg::dat.hdcPic, cfg::dat.bmpBackground));
- ReleaseDC(pcli->hwndContactList, hdcThis);
+ dat->bkChanged = 0;
+ if (cfg::dat.hBrushCLCBk)
+ DeleteObject(cfg::dat.hBrushCLCBk);
+ cfg::dat.hBrushCLCBk = CreateSolidBrush(dat->bkColour);
+ if (dat->hBmpBackground) {
+ if (cfg::dat.hdcPic) {
+ SelectObject(cfg::dat.hdcPic, cfg::dat.hbmPicOld);
+ DeleteDC(cfg::dat.hdcPic);
+ cfg::dat.hdcPic = 0;
+ cfg::dat.hbmPicOld = 0;
}
}
+
+ cfg::dat.bmpBackground = dat->hBmpBackground;
+ if (cfg::dat.bmpBackground) {
+ HDC hdcThis = GetDC(pcli->hwndContactList);
+ GetObject(cfg::dat.bmpBackground, sizeof(cfg::dat.bminfoBg), &(cfg::dat.bminfoBg));
+ cfg::dat.hdcPic = CreateCompatibleDC(hdcThis);
+ cfg::dat.hbmPicOld = reinterpret_cast<HBITMAP>(SelectObject(cfg::dat.hdcPic, cfg::dat.bmpBackground));
+ ReleaseDC(pcli->hwndContactList, hdcThis);
+ }
+
if (cfg::getByte("CLCExt", "EXBK_FillWallpaper", 0)) {
char wpbuf[MAX_PATH];
if (dat->hBmpBackground) {
@@ -597,4 +616,6 @@ void LoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst) ReleaseDC(pcli->hwndContactList, hdcThis);
}
}
+
+ coreCli.pfnLoadClcOptions(hwnd, dat, bFirst);
}
|