From 303c2fb05ca6a8ea2c73b3067773d418aa323399 Mon Sep 17 00:00:00 2001 From: sje Date: Thu, 26 Apr 2007 15:44:54 +0000 Subject: added title underline git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@159 4f64403b-2f21-0410-a795-97e2b3489a10 --- yapp/common.h | 2 +- yapp/popups2.cpp | 27 ++++++++++++++++++++++++--- yapp/popwin.cpp | 13 ++++++++++++- yapp/version.h | 2 +- 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/yapp/common.h b/yapp/common.h index 355f08e..d0d05fd 100644 --- a/yapp/common.h +++ b/yapp/common.h @@ -65,7 +65,7 @@ extern PLUGINLINK *pluginLink; extern HANDLE mainThread; extern HFONT hFontFirstLine, hFontSecondLine, hFontTime; -extern COLORREF colFirstLine, colSecondLine, colBg, colTime, colBorder, colSidebar; +extern COLORREF colFirstLine, colSecondLine, colBg, colTime, colBorder, colSidebar, colTitleUnderline; extern MNOTIFYLINK *notifyLink; diff --git a/yapp/popups2.cpp b/yapp/popups2.cpp index 1597bbc..cb7f561 100644 --- a/yapp/popups2.cpp +++ b/yapp/popups2.cpp @@ -21,13 +21,14 @@ MNOTIFYLINK *notifyLink = 0; bool ignore_gpd_passed_addy = false; FontID font_id_firstline = {0}, font_id_secondline = {0}, font_id_time = {0}; -ColourID colour_id_bg = {0}, colour_id_border = {0}, colour_id_sidebar = {0}; +ColourID colour_id_bg = {0}, colour_id_border = {0}, colour_id_sidebar = {0}, colour_id_titleunderline = {0}; FontIDW font_id_firstlinew = {0}, font_id_secondlinew = {0}, font_id_timew = {0}; -ColourIDW colour_id_bgw = {0}, colour_id_borderw = {0}, colour_id_sidebarw = {0}; +ColourIDW colour_id_bgw = {0}, colour_id_borderw = {0}, colour_id_sidebarw = {0}, colour_id_titleunderlinew = {0}; COLORREF colBg = GetSysColor(COLOR_3DSHADOW); HFONT hFontFirstLine = 0, hFontSecondLine = 0, hFontTime = 0; -COLORREF colFirstLine = RGB(255, 0, 0), colSecondLine = 0, colTime = RGB(0, 0, 255), colBorder = RGB(0, 0, 0), colSidebar = RGB(128, 128, 128); +COLORREF colFirstLine = RGB(255, 0, 0), colSecondLine = 0, colTime = RGB(0, 0, 255), colBorder = RGB(0, 0, 0), + colSidebar = RGB(128, 128, 128), colTitleUnderline = GetSysColor(COLOR_3DSHADOW); // hooked here so it's in the main thread HANDLE hAvChangeEvent = 0; @@ -95,6 +96,7 @@ int ReloadFont(WPARAM wParam, LPARAM lParam) { colBg = CallService(MS_COLOUR_GETW, (WPARAM)&colour_id_bgw, 0); colBorder = CallService(MS_COLOUR_GETW, (WPARAM)&colour_id_borderw, 0); colSidebar = CallService(MS_COLOUR_GETW, (WPARAM)&colour_id_sidebarw, 0); + colTitleUnderline = CallService(MS_COLOUR_GETW, (WPARAM)&colour_id_titleunderlinew, 0); } else { LOGFONTA log_font; if(hFontFirstLine) DeleteObject(hFontFirstLine); @@ -110,6 +112,7 @@ int ReloadFont(WPARAM wParam, LPARAM lParam) { colBg = CallService(MS_COLOUR_GET, (WPARAM)&colour_id_bg, 0); colBorder = CallService(MS_COLOUR_GET, (WPARAM)&colour_id_border, 0); colSidebar = CallService(MS_COLOUR_GET, (WPARAM)&colour_id_sidebar, 0); + colTitleUnderline = CallService(MS_COLOUR_GET, (WPARAM)&colour_id_titleunderline, 0); } return 0; @@ -204,9 +207,18 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) { colour_id_sidebarw.defcolour = RGB(128, 128, 128); colour_id_sidebarw.order = 2; + colour_id_titleunderlinew.cbSize = sizeof(ColourIDW); + t2w(TranslateT("Popups"), colour_id_titleunderlinew.group, 64); + t2w(TranslateT("Title underline"), colour_id_titleunderlinew.name, 64); + strcpy(colour_id_titleunderlinew.dbSettingsGroup, MODULE); + strcpy(colour_id_titleunderlinew.setting, "ColourTitleUnderline"); + colour_id_titleunderlinew.defcolour = GetSysColor(COLOR_3DSHADOW); + colour_id_titleunderlinew.order = 3; + CallService(MS_COLOUR_REGISTERW, (WPARAM)&colour_id_bgw, 0); CallService(MS_COLOUR_REGISTERW, (WPARAM)&colour_id_borderw, 0); CallService(MS_COLOUR_REGISTERW, (WPARAM)&colour_id_sidebarw, 0); + CallService(MS_COLOUR_REGISTERW, (WPARAM)&colour_id_titleunderlinew, 0); ReloadFont(0, 0); @@ -264,9 +276,18 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) { colour_id_sidebar.defcolour = RGB(128, 128, 128); colour_id_sidebar.order = 2; + colour_id_titleunderline.cbSize = sizeof(ColourID); + t2a(TranslateT("Popups"), colour_id_titleunderline.group, 64); + t2a(TranslateT("Title underline"), colour_id_titleunderline.name, 64); + strcpy(colour_id_titleunderline.dbSettingsGroup, MODULE); + strcpy(colour_id_titleunderline.setting, "ColourTitleUnderline"); + colour_id_titleunderline.defcolour = GetSysColor(COLOR_3DSHADOW); + colour_id_titleunderline.order = 3; + CallService(MS_COLOUR_REGISTER, (WPARAM)&colour_id_bg, 0); CallService(MS_COLOUR_REGISTER, (WPARAM)&colour_id_border, 0); CallService(MS_COLOUR_REGISTER, (WPARAM)&colour_id_sidebar, 0); + CallService(MS_COLOUR_REGISTER, (WPARAM)&colour_id_titleunderline, 0); ReloadFont(0, 0); diff --git a/yapp/popwin.cpp b/yapp/popwin.cpp index 4f9c5a3..219e302 100644 --- a/yapp/popwin.cpp +++ b/yapp/popwin.cpp @@ -143,7 +143,7 @@ struct PopupWindowData { int new_x, new_y; bool is_round, av_is_round, mouse_in, close_on_leave; bool custom_col; - HBRUSH bkBrush, barBrush; + HBRUSH bkBrush, barBrush, underlineBrush; HPEN bPen; TCHAR tbuff[128]; int tb_height, av_height, text_height, time_height, time_width; @@ -186,9 +186,11 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa DWORD darkBg = pd->colorBack - ((pd->colorBack >> 2) & 0x3f3f3f); // 3/4 of current individual RGB components pwd->barBrush = CreateSolidBrush(darkBg); // make sidebar a dark version of the bg + pwd->underlineBrush = CreateSolidBrush(pd->colorBack); // make sidebar a dark version of the bg } else { pwd->bkBrush = CreateSolidBrush(colBg); pwd->barBrush = CreateSolidBrush(colSidebar); + pwd->underlineBrush = CreateSolidBrush(colTitleUnderline); } if(options.border) pwd->bPen = (HPEN)CreatePen(PS_SOLID, 1, colBorder); @@ -478,6 +480,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa else SetTextColor(ps.hdc, colFirstLine); DrawTextW(ps.hdc, pd->lptzContactName, wcslen(pd->lpwzContactName), &tr, DT_VCENTER | DT_LEFT | DT_END_ELLIPSIS | DT_SINGLELINE | DT_NOPREFIX); + // title underline + RECT tur; + tur.left = r.left + options.sb_width + options.padding; + tur.right = r.right - options.padding; + tur.top = tr.bottom + options.padding/2; + tur.bottom = tur.top + 1; + FillRect(ps.hdc, &tur, pwd->underlineBrush); + // second line(s) int len_second = wcslen(pd->lpwzText); if(len_second) { @@ -505,6 +515,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa DeleteObject(pwd->bkBrush); DeleteObject(pwd->bPen); DeleteObject(pwd->barBrush); + DeleteObject(pwd->underlineBrush); KillTimer(hwnd, ID_MOVETIMER); KillTimer(hwnd, ID_CLOSETIMER); diff --git a/yapp/version.h b/yapp/version.h index e780dde..7ab59c9 100644 --- a/yapp/version.h +++ b/yapp/version.h @@ -4,7 +4,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 3 #define __RELEASE_NUM 0 -#define __BUILD_NUM 0 +#define __BUILD_NUM 1 #define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM #define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM -- cgit v1.2.3