summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-10-03 16:48:12 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-10-03 16:48:12 +0000
commit0976190894d653d5062f8ef6befabf46218f2d24 (patch)
tree4a26f4baa9a535256d7220a0c04a698390cab4e5 /plugins/AutoShutdown
parent3c4ccf82586be6b22380df2bc35ae4770f91651f (diff)
- inlined helpers for fonts, colors & effects creation replaced with functions;
- services for getting fonts, colors & effects removed; - some memory corruptions removed git-svn-id: http://svn.miranda-ng.org/main/trunk@17347 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AutoShutdown')
-rw-r--r--plugins/AutoShutdown/src/frame.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp
index f89a183373..a450355f22 100644
--- a/plugins/AutoShutdown/src/frame.cpp
+++ b/plugins/AutoShutdown/src/frame.cpp
@@ -223,12 +223,18 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
case M_REFRESH_COLORS:
COLORREF clrBar;
- if (FontService_GetColor(L"Automatic shutdown", L"Progress bar", &clrBar))
+ clrBar = Colour_GetW(L"Automatic shutdown", L"Progress bar");
+ if (clrBar == -1)
clrBar = GetDefaultColor(FRAMEELEMENT_BAR);
- if (FontService_GetColor(L"Automatic shutdown", L"Background", &dat->clrBackground))
+
+ dat->clrBackground = Colour_GetW(L"Automatic shutdown", L"Background");
+ if (dat->clrBackground == -1)
dat->clrBackground = GetDefaultColor(FRAMEELEMENT_BKGRND);
- if (dat->hbrBackground != NULL) DeleteObject(dat->hbrBackground);
+
+ if (dat->hbrBackground != NULL)
+ DeleteObject(dat->hbrBackground);
dat->hbrBackground = CreateSolidBrush(dat->clrBackground);
+
SendMessage(dat->hwndProgress, PBM_SETBARCOLOR, 0, (LPARAM)clrBar);
SendMessage(dat->hwndProgress, PBM_SETBKCOLOR, 0, (LPARAM)dat->clrBackground);
InvalidateRect(hwndFrame, NULL, TRUE);
@@ -240,17 +246,9 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
case M_REFRESH_FONTS:
{
LOGFONT lf;
- if (!FontService_GetFont(L"Automatic shutdown", L"Countdown on frame", &dat->clrText, &lf)) {
- if (dat->hFont != NULL) DeleteObject(dat->hFont);
- dat->hFont = CreateFontIndirect(&lf);
- }
- else {
- dat->clrText = GetDefaultColor(FRAMEELEMENT_TEXT);
- if (GetDefaultFont(&lf) != NULL) {
- if (dat->hFont != NULL) DeleteObject(dat->hFont);
- dat->hFont = CreateFontIndirect(&lf);
- }
- }
+ dat->clrText = Font_GetW(L"Automatic shutdown", L"Countdown on frame", &lf);
+ if (dat->hFont != NULL) DeleteObject(dat->hFont);
+ dat->hFont = CreateFontIndirect(&lf);
}
if (dat->hwndDesc != NULL)
SendMessage(dat->hwndDesc, WM_SETFONT, (WPARAM)dat->hFont, FALSE);