parent
8a6dafb890
commit
6d06000600
|
@ -984,22 +984,28 @@ namespace NppDarkMode
|
|||
hFont = hCreatedFont;
|
||||
}
|
||||
|
||||
if (!hFont) {
|
||||
if (!hFont)
|
||||
{
|
||||
hFont = reinterpret_cast<HFONT>(SendMessage(hwnd, WM_GETFONT, 0, 0));
|
||||
}
|
||||
|
||||
SelectObject(hdc, hFont);
|
||||
|
||||
hOldFont = static_cast<HFONT>(::SelectObject(hdc, hFont));
|
||||
|
||||
WCHAR szText[256] = { 0 };
|
||||
GetWindowText(hwnd, szText, _countof(szText));
|
||||
|
||||
auto style = static_cast<long>(::GetWindowLongPtr(hwnd, GWL_STYLE));
|
||||
bool isCenter = (style & BS_CENTER) == BS_CENTER;
|
||||
|
||||
if (szText[0])
|
||||
{
|
||||
SIZE textSize = { 0 };
|
||||
GetTextExtentPoint32(hdc, szText, static_cast<int>(wcslen(szText)), &textSize);
|
||||
|
||||
int centerPosX = isCenter ? ((rcClient.right - rcClient.left - textSize.cx) / 2) : 7;
|
||||
|
||||
rcBackground.top += textSize.cy / 2;
|
||||
rcText.left += 7;
|
||||
rcText.left += centerPosX;
|
||||
rcText.bottom = rcText.top + textSize.cy;
|
||||
rcText.right = rcText.left + textSize.cx + 4;
|
||||
|
||||
|
@ -1029,7 +1035,9 @@ namespace NppDarkMode
|
|||
DTTOPTS dtto = { sizeof(DTTOPTS), DTT_TEXTCOLOR };
|
||||
dtto.crText = NppDarkMode::getTextColor();
|
||||
|
||||
DrawThemeTextEx(buttonData.hTheme, hdc, BP_GROUPBOX, iStateID, szText, -1, DT_LEFT | DT_SINGLELINE, &rcText, &dtto);
|
||||
DWORD textFlags = isCenter ? DT_CENTER : DT_LEFT;
|
||||
|
||||
DrawThemeTextEx(buttonData.hTheme, hdc, BP_GROUPBOX, iStateID, szText, -1, textFlags | DT_SINGLELINE, &rcText, &dtto);
|
||||
}
|
||||
|
||||
if (hCreatedFont) DeleteObject(hCreatedFont);
|
||||
|
@ -1394,6 +1402,8 @@ namespace NppDarkMode
|
|||
, theme
|
||||
};
|
||||
|
||||
::EnableThemeDialogTexture(hwndParent, theme ? ETDT_ENABLETAB : ETDT_DISABLE);
|
||||
|
||||
EnumChildWindows(hwndParent, [](HWND hwnd, LPARAM lParam) {
|
||||
auto& p = *reinterpret_cast<Params*>(lParam);
|
||||
const size_t classNameLen = 16;
|
||||
|
|
|
@ -44,6 +44,8 @@ INT_PTR CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|||
{
|
||||
case WM_INITDIALOG :
|
||||
{
|
||||
NppDarkMode::autoSubclassAndThemeChildControls(_hSelf);
|
||||
|
||||
switchTo(activeText);
|
||||
::SendDlgItemMessage(_hSelf, IDC_COL_DEC_RADIO, BM_SETCHECK, TRUE, 0);
|
||||
goToCenter();
|
||||
|
@ -57,6 +59,53 @@ INT_PTR CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case WM_CTLCOLOREDIT:
|
||||
{
|
||||
if (NppDarkMode::isEnabled())
|
||||
{
|
||||
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_CTLCOLORDLG:
|
||||
case WM_CTLCOLORSTATIC:
|
||||
{
|
||||
if (NppDarkMode::isEnabled())
|
||||
{
|
||||
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_PRINTCLIENT:
|
||||
{
|
||||
if (NppDarkMode::isEnabled())
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
{
|
||||
if (NppDarkMode::isEnabled())
|
||||
{
|
||||
RECT rc = { 0 };
|
||||
getClientRect(rc);
|
||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case NPPM_INTERNAL_REFRESHDARKMODE:
|
||||
{
|
||||
NppDarkMode::autoThemeChildControls(_hSelf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case WM_COMMAND :
|
||||
{
|
||||
switch (wParam)
|
||||
|
@ -282,7 +331,7 @@ INT_PTR CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|||
default :
|
||||
return FALSE;
|
||||
}
|
||||
//return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void ColumnEditorDlg::switchTo(bool toText)
|
||||
|
@ -299,7 +348,6 @@ void ColumnEditorDlg::switchTo(bool toText)
|
|||
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_INCREASENUM_EDIT), !toText);
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_REPEATNUM_STATIC), !toText);
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_REPEATNUM_EDIT), !toText);
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_FORMAT_GRP_STATIC), !toText);
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_DEC_RADIO), !toText);
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_HEX_RADIO), !toText);
|
||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_OCT_RADIO), !toText);
|
||||
|
@ -321,4 +369,3 @@ UCHAR ColumnEditorDlg::getFormat()
|
|||
f = 3;
|
||||
return (f | (isLeadingZeros?MASK_ZERO_LEADING:0));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue