Compare commits
3 Commits
81bc578773
...
efb25b8aae
Author | SHA1 | Date | |
---|---|---|---|
efb25b8aae | |||
e72793e315 | |||
5a412ab6e2 |
22
xW/xW.cpp
22
xW/xW.cpp
@ -499,7 +499,7 @@ convert_item_formatting(Relay::ItemData *item, CHARFORMAT2 &cf, bool &inverse)
|
||||
}
|
||||
|
||||
static std::vector<BufferLineItem>
|
||||
convert_items(std::vector<std::unique_ptr<Relay::ItemData>> &items)
|
||||
convert_items(const std::vector<std::unique_ptr<Relay::ItemData>> &items)
|
||||
{
|
||||
CHARFORMAT2 cf = default_charformat();
|
||||
std::vector<BufferLineItem> result;
|
||||
@ -685,10 +685,12 @@ buffer_print_line(std::vector<BufferLine>::const_iterator begin,
|
||||
static void
|
||||
buffer_print_separator()
|
||||
{
|
||||
bool sameline = !GetWindowTextLength(g.hwndBuffer);
|
||||
|
||||
CHARFORMAT2 format = default_charformat();
|
||||
format.dwEffects &= ~CFE_AUTOCOLOR;
|
||||
format.crTextColor = RGB(0xff, 0x5f, 0x00);
|
||||
richedit_replacesel(g.hwndBuffer, &format, L"\n---");
|
||||
richedit_replacesel(g.hwndBuffer, &format, &L"\n---"[sameline]);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -954,6 +956,7 @@ relay_process_message(const Relay::EventMessage &m)
|
||||
b->highlighted = false;
|
||||
SendMessage(g.hwndBufferList, LB_SETCURSEL, b - g.buffers.data(), 0);
|
||||
|
||||
refresh_icon();
|
||||
refresh_topic(b->topic);
|
||||
refresh_buffer(*b);
|
||||
refresh_prompt();
|
||||
@ -1627,6 +1630,21 @@ window_proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
if (auto b = buffer_by_name(g.buffer_current))
|
||||
refresh_buffer(*b);
|
||||
return 0;
|
||||
case WM_SYSCOLORCHANGE:
|
||||
// The topic would flicker with WS_EX_TRANSPARENT.
|
||||
// The buffer only changed its text colour, not background.
|
||||
SendMessage(g.hwndTopic,
|
||||
EM_SETBKGNDCOLOR, 0, GetSysColor(COLOR_3DFACE));
|
||||
SendMessage(g.hwndBuffer,
|
||||
EM_SETBKGNDCOLOR, 1, 0);
|
||||
|
||||
// XXX: This is incomplete, we'd have to run convert_items() again;
|
||||
// essentially only COLOR_GRAYTEXT is reloaded in here.
|
||||
if (auto b = buffer_by_name(g.buffer_current))
|
||||
refresh_buffer(*b);
|
||||
|
||||
// Pass it to all child windows, through DefWindowProc().
|
||||
break;
|
||||
case WM_ACTIVATE:
|
||||
if (LOWORD(wParam) == WA_INACTIVE)
|
||||
g.hwndLastFocused = GetFocus();
|
||||
|
Loading…
x
Reference in New Issue
Block a user