Fix a minor bug for vertical edge

This commit is contained in:
Don HO 2020-04-18 20:59:45 +02:00
parent 3a46a6c23d
commit 126b55b064
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

View File

@ -592,7 +592,7 @@ static LRESULT CALLBACK editNumSpaceProc(HWND hwnd, UINT message, WPARAM wParam,
void MarginsDlg::initScintParam() void MarginsDlg::initScintParam()
{ {
NppParameters& nppParam = NppParameters::getInstance(); NppParameters& nppParam = NppParameters::getInstance();
const ScintillaViewParams & svp = nppParam.getSVP(); ScintillaViewParams & svp = const_cast<ScintillaViewParams &>(nppParam.getSVP());
::SendDlgItemMessage(_hSelf, IDC_RADIO_BOX, BM_SETCHECK, FALSE, 0); ::SendDlgItemMessage(_hSelf, IDC_RADIO_BOX, BM_SETCHECK, FALSE, 0);
::SendDlgItemMessage(_hSelf, IDC_RADIO_CIRCLE, BM_SETCHECK, FALSE, 0); ::SendDlgItemMessage(_hSelf, IDC_RADIO_CIRCLE, BM_SETCHECK, FALSE, 0);
@ -642,7 +642,18 @@ void MarginsDlg::initScintParam()
::SendDlgItemMessage(_hSelf, IDC_CHECK_NOEDGE, BM_SETCHECK, !svp._showBorderEdge, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_NOEDGE, BM_SETCHECK, !svp._showBorderEdge, 0);
bool canBeBg = svp._edgeMultiColumnPos.size() == 1;
if (!canBeBg)
{
svp._isEdgeBgMode = false;
::SendDlgItemMessage(_hSelf, IDC_CHECK_EDGEBGMODE, BM_SETCHECK, FALSE, 0);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_EDGEBGMODE), FALSE);
}
else
{
::SendDlgItemMessage(_hSelf, IDC_CHECK_EDGEBGMODE, BM_SETCHECK, svp._isEdgeBgMode, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_EDGEBGMODE, BM_SETCHECK, svp._isEdgeBgMode, 0);
}
generic_string edgeColumnPosStr; generic_string edgeColumnPosStr;
for (auto i : svp._edgeMultiColumnPos) for (auto i : svp._edgeMultiColumnPos)
@ -721,7 +732,7 @@ INT_PTR CALLBACK MarginsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPa
case WM_COMMAND : case WM_COMMAND :
{ {
ScintillaViewParams & svp = (ScintillaViewParams &)nppParam.getSVP(); ScintillaViewParams & svp = const_cast<ScintillaViewParams &>(nppParam.getSVP());
switch (wParam) switch (wParam)
{ {
case IDC_CHECK_SMOOTHFONT: case IDC_CHECK_SMOOTHFONT: