Author: sagamusix
Date: Tue Apr 9 20:12:09 2024
New Revision: 20546
URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20546
Log:
[Mod] Comments tab: Also apply fixed-width font to filenames.
Modified:
trunk/OpenMPT/mptrack/view_com.cpp
Modified: trunk/OpenMPT/mptrack/view_com.cpp
==============================================================================
--- trunk/OpenMPT/mptrack/view_com.cpp Tue Apr 9 20:04:10 2024 (r20545)
+++ trunk/OpenMPT/mptrack/view_com.cpp Tue Apr 9 20:12:09 2024 (r20546)
@@ -64,7 +64,7 @@
{ _T("Type"), 80, LVCFMT_RIGHT },
{ _T("C-5 Freq"), 80, LVCFMT_RIGHT },
{ _T("Instr"), 64, LVCFMT_RIGHT },
- { _T("File Name"), 128, LVCFMT_RIGHT },
+ { _T("File Name"), 160, LVCFMT_RIGHT },
{ _T("Path"), 256, LVCFMT_LEFT },
};
@@ -74,7 +74,7 @@
{ _T("Num"), 45, LVCFMT_RIGHT },
{ _T("Samples"), 64, LVCFMT_RIGHT },
{ _T("Envelopes"), 128, LVCFMT_RIGHT },
- { _T("File Name"), 128, LVCFMT_RIGHT },
+ { _T("File Name"), 160, LVCFMT_RIGHT },
{ _T("Plugin"), 128, LVCFMT_RIGHT },
};
@@ -690,6 +690,7 @@
const auto &lvcd = *reinterpret_cast<NMLVCUSTOMDRAW *>(pNMHDR);
*pResult = CDRF_DODEFAULT;
+ const bool useFont = lvcd.iSubItem == 0 || (m_nListId == IDC_LIST_SAMPLES && lvcd.iSubItem == SMPLIST_FILENAME) || (m_nListId == IDC_LIST_INSTRUMENTS && lvcd.iSubItem == INSLIST_FILENAME);
switch(lvcd.nmcd.dwDrawStage)
{
case CDDS_PREPAINT:
@@ -699,14 +700,14 @@
*pResult = CDRF_NOTIFYSUBITEMDRAW;
break;
case CDDS_ITEMPREPAINT | CDDS_SUBITEM:
- if(lvcd.iSubItem == 0)
+ if(useFont)
{
m_oldFont = SelectFont(lvcd.nmcd.hdc, m_fixedFont);
*pResult = CDRF_NEWFONT | CDRF_NOTIFYPOSTPAINT;
}
break;
case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM:
- if(lvcd.iSubItem == 0)
+ if(useFont)
{
SelectFont(lvcd.nmcd.hdc, m_oldFont);
*pResult = CDRF_NEWFONT;
|