diff options
author | George Hazan <george.hazan@gmail.com> | 2013-02-05 14:49:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-02-05 14:49:25 +0000 |
commit | 0233716a1aeab439b0195408a76285fd2ecbbe93 (patch) | |
tree | dc2fa3b38320ea8398272cf4dd7b9207b381596b /plugins/MyDetails/src/frame.cpp | |
parent | f0b70db9efcaf1b5d5e8c7723fa0be118ebc1f5e (diff) |
slightly optimized color creation
git-svn-id: http://svn.miranda-ng.org/main/trunk@3439 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MyDetails/src/frame.cpp')
-rw-r--r-- | plugins/MyDetails/src/frame.cpp | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index c9c26968d0..476c286e5f 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -73,7 +73,10 @@ char font_sizes[] = { 13, 8, 8, 8, 8 }; BYTE font_styles[] = { DBFONTF_BOLD, 0, 0, DBFONTF_ITALIC, DBFONTF_ITALIC };
COLORREF font_colors[] = { RGB(0,0,0), RGB(0,0,0), RGB(0,0,0), RGB(150,150,150), RGB(150,150,150) };
-ColourIDT bg_colour, av_colour;
+static ColourID
+ bg_colour = { sizeof(bg_colour), LPGEN("My Details"), LPGEN("Background"), MODULE_NAME, "BackgroundColor", 0, GetSysColor(COLOR_BTNFACE) },
+ av_colour = { sizeof(av_colour), LPGEN("My Details"), LPGEN("Avatar Border"), MODULE_NAME, "AvatarBorderColor", 0, RGB(0,0,0) };
+
int CreateFrame();
void FixMainMenu();
void RefreshFrame();
@@ -207,8 +210,8 @@ int ReloadFont(WPARAM wParam, LPARAM lParam) int ReloadColour(WPARAM,LPARAM)
{
- opts.bkg_color = (COLORREF) CallService(MS_COLOUR_GETT,(WPARAM)&bg_colour,0);
- opts.draw_avatar_border_color = (COLORREF) CallService(MS_COLOUR_GETT,(WPARAM)&av_colour,0);
+ opts.bkg_color = (COLORREF)CallService(MS_COLOUR_GET,(WPARAM)&bg_colour,0);
+ opts.draw_avatar_border_color = (COLORREF)CallService(MS_COLOUR_GET,(WPARAM)&av_colour,0);
RefreshFrame();
return 0;
@@ -224,25 +227,10 @@ int CreateFrame() {
HDC hdc = GetDC(NULL);
- ZeroMemory(&bg_colour, sizeof(bg_colour));
- bg_colour.cbSize = sizeof(ColourIDT);
- _tcsncpy(bg_colour.name,LPGENT("Background"),SIZEOF(bg_colour.name));
- _tcsncpy(bg_colour.group,LPGENT("My Details"),SIZEOF(bg_colour.group));
- strncpy(bg_colour.dbSettingsGroup,MODULE_NAME,sizeof(bg_colour.dbSettingsGroup));
- strncpy(bg_colour.setting,"BackgroundColor",sizeof(bg_colour.setting));
- bg_colour.defcolour = GetSysColor(COLOR_BTNFACE);
- ColourRegisterT(&bg_colour);
-
- ZeroMemory(&av_colour, sizeof(av_colour));
- av_colour.cbSize = sizeof(ColourIDT);
- _tcsncpy(av_colour.name,LPGENT("Avatar Border"),SIZEOF(av_colour.name));
- _tcsncpy(av_colour.group,LPGENT("My Details"),SIZEOF(av_colour.group));
- strncpy(av_colour.dbSettingsGroup,MODULE_NAME,sizeof(av_colour.dbSettingsGroup));
- strncpy(av_colour.setting,"AvatarBorderColor",sizeof(av_colour.setting));
- av_colour.defcolour = RGB(0,0,0);
- ColourRegisterT(&av_colour);
+ ColourRegister(&bg_colour);
+ ColourRegister(&av_colour);
ReloadColour(0,0);
- HookEvent(ME_COLOUR_RELOAD,ReloadColour);
+ HookEvent(ME_COLOUR_RELOAD, ReloadColour);
for (int i = 0 ; i < NUM_FONTS ; i++) {
ZeroMemory(&font_id[i], sizeof(font_id[i]));
|