From 0c6e7add012d365de455ace73f34e15b5510c0d1 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 10 Jun 2018 23:03:54 -0400 Subject: [PATCH] Experimented with custom-drawing the text, this time in a nicer place thatn the default. Okay, this isn't too bad, especially now that it seems everything is vertically centered... --- windows/table.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/windows/table.cpp b/windows/table.cpp index 66de886e..bfb9751e 100644 --- a/windows/table.cpp +++ b/windows/table.cpp @@ -177,6 +177,18 @@ static LRESULT onNM_CUSTOMDRAW(uiTable *t, NMLVCUSTOMDRAW *nm) // TODO draw background on image columns if needed ret = CDRF_NEWFONT; break; +case CDDS_SUBITEM | CDDS_ITEMPOSTPAINT: +if(nm->iSubItem == 1) { +RECT r, r2; +r.left = LVIR_LABEL; +r.top = 1; +SendMessageW(t->hwnd, LVM_GETSUBITEMRECT, nm->nmcd.dwItemSpec, (LPARAM)(&r)); +r2.left = LVIR_ICON; +r2.top = 1; +SendMessageW(t->hwnd, LVM_GETSUBITEMRECT, nm->nmcd.dwItemSpec, (LPARAM)(&r2)); +r.left = r2.right + 2; +DrawTextW(nm->nmcd.hdc, L"Part", -1, +&r, DT_LEFT | DT_VCENTER | DT_END_ELLIPSIS | DT_SINGLELINE | DT_NOPREFIX | DT_EDITCONTROL);} default: ret = CDRF_DODEFAULT; }