diff options
author | George Hazan <george.hazan@gmail.com> | 2023-08-23 17:17:02 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-08-23 17:17:02 +0300 |
commit | 96f4d0b60a1b019a18e7ebcc392b21628c77f602 (patch) | |
tree | 5bfc958e5e9227da627d17953557f7944e768e68 | |
parent | 1e969ff37f7e2513eda21d9afcaaa515ce1eef05 (diff) |
fixes #3655 (NewStory: добавить настройку цвета хайлайтов)
-rw-r--r-- | plugins/NewStory/src/fonts.cpp | 59 | ||||
-rw-r--r-- | plugins/NewStory/src/fonts.h | 4 | ||||
-rw-r--r-- | plugins/NewStory/src/history_array.cpp | 1 | ||||
-rw-r--r-- | plugins/NewStory/src/history_array.h | 2 | ||||
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 7 |
5 files changed, 42 insertions, 31 deletions
diff --git a/plugins/NewStory/src/fonts.cpp b/plugins/NewStory/src/fonts.cpp index 179a78416b..276f7638a8 100644 --- a/plugins/NewStory/src/fonts.cpp +++ b/plugins/NewStory/src/fonts.cpp @@ -2,40 +2,42 @@ MyColourID g_colorTable[COLOR_COUNT] = { - { LPGEN("Incoming name"), "ColorNickIn", RGB(0xc8, 0x3f, 0x6b) }, - { LPGEN("Outgoing name"), "ColorNickOut", RGB(0x08, 0x60, 0xbd) }, - - { LPGEN("Incoming messages"), "ColorMsgIn", RGB(0xd6, 0xf5, 0xc0) }, - { LPGEN("Outgoing messages"), "ColorMsgOut", RGB(0xf5, 0xe7, 0xd8) }, - - { LPGEN("Incoming files"), "ColorFileIn", RGB(0xe3, 0xee, 0x9b) }, - { LPGEN("Outgoing files"), "ColorFileOut", RGB(0xe3, 0xee, 0x9b) }, - - { LPGEN("Status changes"), "ColorStatus", RGB(0xf0, 0xf0, 0xf0) }, - - { LPGEN("Other incoming events"), "ColorIn", RGB(0xff, 0xff, 0xff) }, - { LPGEN("Other outgoing events"), "ColorOut", RGB(0xff, 0xff, 0xff) }, - - { LPGEN("Selected item's text"), "ColorSelTxt", RGB(0xff, 0xff, 0xff) }, - { LPGEN("Selected item's background"), "ColorSel", GetSysColor(COLOR_HIGHLIGHT) }, - { LPGEN("Selected item's frame"), "ColorSelFrm", GetSysColor(COLOR_HIGHLIGHTTEXT) }, - - { LPGEN("Grid background"), "Background", RGB(0xff, 0xff, 0xff) }, - { LPGEN("Separator"), "Separator", RGB(0x60, 0x60, 0x60) }, + { LPGEN("Incoming name"), "ColorNickIn", RGB(0xc8, 0x3f, 0x6b) }, + { LPGEN("Outgoing name"), "ColorNickOut", RGB(0x08, 0x60, 0xbd) }, + + { LPGEN("Incoming messages"), "ColorMsgIn", RGB(0xd6, 0xf5, 0xc0) }, + { LPGEN("Outgoing messages"), "ColorMsgOut", RGB(0xf5, 0xe7, 0xd8) }, + + { LPGEN("Incoming files"), "ColorFileIn", RGB(0xe3, 0xee, 0x9b) }, + { LPGEN("Outgoing files"), "ColorFileOut", RGB(0xe3, 0xee, 0x9b) }, + + { LPGEN("Status changes"), "ColorStatus", RGB(0xf0, 0xf0, 0xf0) }, + + { LPGEN("Other incoming events"), "ColorIn", RGB(0xff, 0xff, 0xff) }, + { LPGEN("Other outgoing events"), "ColorOut", RGB(0xff, 0xff, 0xff) }, + + { LPGEN("Selected item's text"), "ColorSelTxt", RGB(0xff, 0xff, 0xff) }, + { LPGEN("Selected item's background"), "ColorSel", GetSysColor(COLOR_HIGHLIGHT) }, + { LPGEN("Selected item's frame"), "ColorSelFrm", GetSysColor(COLOR_HIGHLIGHTTEXT) }, + + { LPGEN("Highlight"), "ColorHighlight", RGB(0xf0, 0xf0, 0xf0) }, + { LPGEN("Grid background"), "Background", RGB(0xff, 0xff, 0xff) }, + { LPGEN("Separator"), "Separator", RGB(0x60, 0x60, 0x60) }, }; MyFontID g_fontTable[FONT_COUNT] = { - { LPGEN("Incoming messages"), "FontMsgIn" }, - { LPGEN("Outgoing messages"), "FontMsgOut" }, + { LPGEN("Incoming messages"), "FontMsgIn" }, + { LPGEN("Outgoing messages"), "FontMsgOut" }, + + { LPGEN("Incoming files"), "FontFileIn" }, + { LPGEN("Outgoing files"), "FontFileOut" }, - { LPGEN("Incoming files"), "FontFileIn" }, - { LPGEN("Outgoing files"), "FontFileOut" }, + { LPGEN("Status changes"), "FontStatus" }, + { LPGEN("Highlight"), "FontHighlight", DBFONTF_BOLD, RGB(0x7f, 0, 0) }, - { LPGEN("Status changes"), "FontStatus" }, - - { LPGEN("Other incoming events"), "FontIn" }, - { LPGEN("Other outgoing events"), "FontOut" } + { LPGEN("Other incoming events"), "FontIn" }, + { LPGEN("Other outgoing events"), "FontOut" }, }; int evtFontsChanged(WPARAM, LPARAM) @@ -93,6 +95,7 @@ void InitFonts() fontid.order = int(&it - g_fontTable); strncpy_s(fontid.name, it.szName, _TRUNCATE); strncpy_s(fontid.setting, it.szSetting, _TRUNCATE); + fontid.deffontsettings.style = it.style; fontid.deffontsettings.colour = it.defaultValue; g_plugin.addFont(&fontid); diff --git a/plugins/NewStory/src/fonts.h b/plugins/NewStory/src/fonts.h index 55875643c6..8e19ef7f8e 100644 --- a/plugins/NewStory/src/fonts.h +++ b/plugins/NewStory/src/fonts.h @@ -11,7 +11,7 @@ enum COLOR_STATUS, COLOR_INOTHER, COLOR_OUTOTHER, COLOR_SELTEXT, COLOR_SELBACK, COLOR_SELFRAME, - COLOR_BACK, COLOR_FRAME, + COLOR_HIGHLIGHT_BACK, COLOR_BACK, COLOR_FRAME, COLOR_COUNT }; @@ -32,6 +32,7 @@ enum FONT_INFILE, FONT_OUTFILE, FONT_STATUS, + FONT_HIGHLIGHT, FONT_INOTHER, FONT_OUTOTHER, FONT_COUNT @@ -40,6 +41,7 @@ enum struct MyFontID { const char *szName, *szSetting; + uint8_t style; COLORREF defaultValue, cl; LOGFONTA lf; diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index f168335562..f6c2b13268 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -355,6 +355,7 @@ void HistoryArray::addChatEvent(SESSION_INFO *si, const LOGINFO *lin) p.hContact = si->hContact; p.wtext = wszText.Detach(); p.m_bLoaded = true; + p.m_bHighlighted = lin->bIsHighlighted; p.dbe.timestamp = lin->time; switch (lin->iType) { diff --git a/plugins/NewStory/src/history_array.h b/plugins/NewStory/src/history_array.h index d3f523886b..b38024f28a 100644 --- a/plugins/NewStory/src/history_array.h +++ b/plugins/NewStory/src/history_array.h @@ -14,7 +14,7 @@ struct ItemData MEVENT hEvent; bool m_bRtf; - bool m_bSelected; + bool m_bSelected, m_bHighlighted; bool m_bLoaded; bool m_bOfflineFile, m_bOfflineDownloaded; uint8_t m_grouping; diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index f2c2754a36..34dd45fe0d 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -445,7 +445,12 @@ int NewstoryListData::PaintItem(HDC hdc, int index, int top, int width) item->getFontColor(fontid, colorid); clText = g_fontTable[fontid].cl; - if (item->m_bSelected) { + if (item->m_bHighlighted) { + clText = g_fontTable[FONT_HIGHLIGHT].cl; + clBack = g_colorTable[COLOR_HIGHLIGHT_BACK].cl; + clLine = g_colorTable[COLOR_FRAME].cl; + } + else if (item->m_bSelected) { clText = g_colorTable[COLOR_SELTEXT].cl; clBack = g_colorTable[COLOR_SELBACK].cl; clLine = g_colorTable[COLOR_SELFRAME].cl; |