Restore edit zone border in dark mode
Restore functionality for option No edge in preference when using dark mode. Fix #10205, close #10211
This commit is contained in:
parent
1182976cc3
commit
8bf11be0b5
|
@ -284,16 +284,8 @@ LRESULT Notepad_plus::init(HWND hwnd)
|
||||||
_subEditView.execute(SCI_SETFONTQUALITY, SC_EFF_QUALITY_LCD_OPTIMIZED);
|
_subEditView.execute(SCI_SETFONTQUALITY, SC_EFF_QUALITY_LCD_OPTIMIZED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NppDarkMode::isEnabled())
|
|
||||||
{
|
|
||||||
_mainEditView.setBorderEdge(false);
|
|
||||||
_subEditView.setBorderEdge(false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_mainEditView.setBorderEdge(svp._showBorderEdge);
|
_mainEditView.setBorderEdge(svp._showBorderEdge);
|
||||||
_subEditView.setBorderEdge(svp._showBorderEdge);
|
_subEditView.setBorderEdge(svp._showBorderEdge);
|
||||||
}
|
|
||||||
|
|
||||||
_mainEditView.execute(SCI_SETCARETLINEVISIBLEALWAYS, true);
|
_mainEditView.execute(SCI_SETCARETLINEVISIBLEALWAYS, true);
|
||||||
_subEditView.execute(SCI_SETCARETLINEVISIBLEALWAYS, true);
|
_subEditView.execute(SCI_SETCARETLINEVISIBLEALWAYS, true);
|
||||||
|
|
|
@ -1511,16 +1511,8 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
case NPPM_SETEDITORBORDEREDGE:
|
case NPPM_SETEDITORBORDEREDGE:
|
||||||
{
|
{
|
||||||
bool withBorderEdge = (lParam == 1);
|
bool withBorderEdge = (lParam == 1);
|
||||||
if (NppDarkMode::isEnabled())
|
|
||||||
{
|
|
||||||
_mainEditView.setBorderEdge(false);
|
|
||||||
_subEditView.setBorderEdge(false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_mainEditView.setBorderEdge(withBorderEdge);
|
_mainEditView.setBorderEdge(withBorderEdge);
|
||||||
_subEditView.setBorderEdge(withBorderEdge);
|
_subEditView.setBorderEdge(withBorderEdge);
|
||||||
}
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2746,4 +2738,3 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
_pluginsManager.relayNppMessages(message, wParam, lParam);
|
_pluginsManager.relayNppMessages(message, wParam, lParam);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3705,13 +3705,29 @@ generic_string ScintillaEditView::getEOLString()
|
||||||
|
|
||||||
void ScintillaEditView::setBorderEdge(bool doWithBorderEdge)
|
void ScintillaEditView::setBorderEdge(bool doWithBorderEdge)
|
||||||
{
|
{
|
||||||
|
long style = static_cast<long>(::GetWindowLongPtr(_hSelf, GWL_STYLE));
|
||||||
long exStyle = static_cast<long>(::GetWindowLongPtr(_hSelf, GWL_EXSTYLE));
|
long exStyle = static_cast<long>(::GetWindowLongPtr(_hSelf, GWL_EXSTYLE));
|
||||||
|
|
||||||
|
if (NppDarkMode::isEnabled())
|
||||||
|
{
|
||||||
|
exStyle &= ~WS_EX_CLIENTEDGE;
|
||||||
|
|
||||||
|
if (doWithBorderEdge)
|
||||||
|
style |= WS_BORDER;
|
||||||
|
else
|
||||||
|
style &= ~WS_BORDER;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
style &= ~WS_BORDER;
|
||||||
|
|
||||||
if (doWithBorderEdge)
|
if (doWithBorderEdge)
|
||||||
exStyle |= WS_EX_CLIENTEDGE;
|
exStyle |= WS_EX_CLIENTEDGE;
|
||||||
else
|
else
|
||||||
exStyle &= ~WS_EX_CLIENTEDGE;
|
exStyle &= ~WS_EX_CLIENTEDGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
::SetWindowLongPtr(_hSelf, GWL_STYLE, style);
|
||||||
::SetWindowLongPtr(_hSelf, GWL_EXSTYLE, exStyle);
|
::SetWindowLongPtr(_hSelf, GWL_EXSTYLE, exStyle);
|
||||||
::SetWindowPos(_hSelf, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
::SetWindowPos(_hSelf, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue