From 14d5f0827738090a3b0410beae0dd0190bbcfea7 Mon Sep 17 00:00:00 2001 From: slotwin Date: Sun, 18 May 2014 14:07:33 +0000 Subject: Popup: allow effects in Action/Hovered action font settings Proper capitalization git-svn-id: http://svn.miranda-ng.org/main/trunk@9228 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Popup/src/font.cpp | 49 +++++++++++++++++++++++----------------------- plugins/Popup/src/font.h | 4 ++-- 2 files changed, 27 insertions(+), 26 deletions(-) (limited to 'plugins/Popup/src') diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp index defe5852c6..034a8f002c 100644 --- a/plugins/Popup/src/font.cpp +++ b/plugins/Popup/src/font.cpp @@ -34,38 +34,39 @@ void InitFonts() { fid.flags = FIDF_DEFAULTVALID; fid.deffontsettings.charset = DEFAULT_CHARSET; fid.deffontsettings.size = -11; - lstrcpyn(fid.backgroundGroup,_T(PU_FNT_AND_COLOR), SIZEOF(fid.backgroundGroup)); - lstrcpyn(fid.backgroundName,PU_COL_BACK_NAME, SIZEOF(fid.backgroundName)); + lstrcpyn(fid.backgroundGroup, _T(PU_FNT_AND_COLOR), SIZEOF(fid.backgroundGroup)); + lstrcpyn(fid.backgroundName, PU_COL_BACK_NAME, SIZEOF(fid.backgroundName)); lstrcpyn(fid.deffontsettings.szFace, _T("Tahoma"), SIZEOF(fid.deffontsettings.szFace)); lstrcpyn(fid.name, _T(PU_FNT_NAME_TITLE), SIZEOF(fid.name)); mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TITLE); fid.deffontsettings.style = DBFONTF_BOLD; - fid.deffontsettings.colour = RGB(0,0,0); + fid.deffontsettings.colour = RGB(0, 0, 0); FontRegisterT(&fid); lstrcpyn(fid.name, _T(PU_FNT_NAME_CLOCK), SIZEOF(fid.name)); mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_CLOCK); //fid.deffontsettings.style = DBFONTF_BOLD; - //fid.deffontsettings.colour = RGB(0,0,0); + //fid.deffontsettings.colour = RGB(0, 0, 0); FontRegisterT(&fid); lstrcpyn(fid.name, _T(PU_FNT_NAME_TEXT), SIZEOF(fid.name)); mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TEXT); fid.deffontsettings.style = 0; - //fid.deffontsettings.colour = RGB(0,0,0); + //fid.deffontsettings.colour = RGB(0, 0, 0); FontRegisterT(&fid); lstrcpyn(fid.name, _T(PU_FNT_NAME_ACTION), SIZEOF(fid.name)); mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_ACTION); - //fid.deffontsettings.style = 0; - fid.deffontsettings.colour = RGB(0,0,255); + fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS; + //fid.deffontsettings.style = 0; + fid.deffontsettings.colour = RGB(0, 0, 255); FontRegisterT(&fid); lstrcpyn(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), SIZEOF(fid.name)); mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION); - fid.deffontsettings.style = DBFONTF_UNDERLINE; - //fid.deffontsettings.colour = RGB(0,0,255); + fid.deffontsettings.style = DBFONTF_UNDERLINE; + //fid.deffontsettings.colour = RGB(0, 0, 255); FontRegisterT(&fid); ColourIDT cid = {0}; @@ -95,49 +96,49 @@ void ReloadFonts() if (fonts.action) DeleteObject(fonts.action); if (fonts.actionHover) DeleteObject(fonts.actionHover); - LOGFONT lf = {0}; - FontIDT fid = {0}; - fid.cbSize = sizeof(FontIDT); - lstrcpyn(fid.group, _T(PU_FNT_AND_COLOR),SIZEOF(fid.name)); + LOGFONT lf = {0}; + FontIDT fid = {0}; + fid.cbSize = sizeof(FontIDT); + lstrcpyn(fid.group, _T(PU_FNT_AND_COLOR), SIZEOF(fid.name)); - lstrcpyn(fid.name, _T(PU_FNT_NAME_TITLE),SIZEOF(fid.name)); + lstrcpyn(fid.name, _T(PU_FNT_NAME_TITLE), SIZEOF(fid.name)); fonts.clTitle = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf); fonts.title = CreateFontIndirect(&lf); - lstrcpyn(fid.name, _T(PU_FNT_NAME_CLOCK),SIZEOF(fid.name)); + lstrcpyn(fid.name, _T(PU_FNT_NAME_CLOCK), SIZEOF(fid.name)); fonts.clClock = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf); fonts.clock = CreateFontIndirect(&lf); - lstrcpyn(fid.name, _T(PU_FNT_NAME_TEXT),SIZEOF(fid.name)); + lstrcpyn(fid.name, _T(PU_FNT_NAME_TEXT), SIZEOF(fid.name)); fonts.clText = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf); fonts.text = CreateFontIndirect(&lf); - lstrcpyn(fid.name, _T(PU_FNT_NAME_ACTION),SIZEOF(fid.name)); + lstrcpyn(fid.name, _T(PU_FNT_NAME_ACTION), SIZEOF(fid.name)); fonts.clAction = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf); fonts.action = CreateFontIndirect(&lf); - lstrcpyn(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION),SIZEOF(fid.name)); + lstrcpyn(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), SIZEOF(fid.name)); fonts.clActionHover = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf); fonts.actionHover = CreateFontIndirect(&lf); ColourIDT cid = {0}; cid.cbSize = sizeof(ColourIDT); - lstrcpyn(cid.group, _T(PU_FNT_AND_COLOR),SIZEOF(cid.group)); - lstrcpyn(cid.name, PU_COL_BACK_NAME,SIZEOF(cid.name)); + lstrcpyn(cid.group, _T(PU_FNT_AND_COLOR), SIZEOF(cid.group)); + lstrcpyn(cid.name, PU_COL_BACK_NAME, SIZEOF(cid.name)); fonts.clBack = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf); - lstrcpyn(cid.group, _T(PU_FNT_AND_COLOR),SIZEOF(cid.group)); - lstrcpyn(cid.name, PU_COL_AVAT_NAME,SIZEOF(cid.name)); + lstrcpyn(cid.group, _T(PU_FNT_AND_COLOR), SIZEOF(cid.group)); + lstrcpyn(cid.name, PU_COL_AVAT_NAME, SIZEOF(cid.name)); fonts.clAvatarBorder = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf); //update class popupps(only temp at this point, must rework) char setting[256]; - for(int i=0; i < gTreeData.getCount(); i++) { + for (int i = 0; i < gTreeData.getCount(); i++) { if (gTreeData[i]->typ == 2) { mir_snprintf(setting, 256, "%s/TextCol", gTreeData[i]->pupClass.pszName); gTreeData[i]->colorText = gTreeData[i]->pupClass.colorText = (COLORREF)db_get_dw(0, PU_MODULCLASS, setting, (DWORD)fonts.clText); - mir_snprintf(setting, 256, "%s/BgCol", gTreeData[i]->pupClass.pszName); + mir_snprintf(setting, 256, "%s/BgCol", gTreeData[i]->pupClass.pszName); gTreeData[i]->colorBack = gTreeData[i]->pupClass.colorBack = (COLORREF)db_get_dw(0, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/); } diff --git a/plugins/Popup/src/font.h b/plugins/Popup/src/font.h index b015cfc90b..b3b682e361 100644 --- a/plugins/Popup/src/font.h +++ b/plugins/Popup/src/font.h @@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define PU_FNT_NAME_CLOCK LPGEN("Clock") #define PU_FNT_NAME_TEXT LPGEN("Text") #define PU_FNT_NAME_ACTION LPGEN("Action") -#define PU_FNT_NAME_HOVERED_ACTION LPGEN("Hovered Action") +#define PU_FNT_NAME_HOVERED_ACTION LPGEN("Hovered action") #define PU_COL_BACK_NAME LPGENT("Background") #define PU_COL_BACK_SETTING "ColourBg" @@ -43,7 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define PU_COL_SIDE_SETTING "ColourSidebar" #define PU_COL_LINE_NAME LPGENT("Title underline") #define PU_COL_LINE_SETTING "ColourUnderline" -#define PU_COL_AVAT_NAME LPGENT("Avatar Border") +#define PU_COL_AVAT_NAME LPGENT("Avatar border") #define PU_COL_AVAT_SETTING "ColourAvatarBorder" struct PopupFonts -- cgit v1.2.3