Reset the wxSTC cursor when the DPI changes

This causes the cursor to be recreated (when necessary) at the correct DPI.
This commit is contained in:
Maarten Bent
2020-05-31 23:37:08 +02:00
parent 6eb357f038
commit 951974f808
2 changed files with 10 additions and 0 deletions

View File

@@ -5436,6 +5436,11 @@ void wxStyledTextCtrl::OnGainFocus(wxFocusEvent& evt) {
void wxStyledTextCtrl::OnDPIChanged(wxDPIChangedEvent& evt) {
m_swx->DoInvalidateStyleData();
// trigger a cursor change, so any cursors created by wxWidgets (like reverse arrow) will be recreated
const int oldCursor = GetSTCCursor();
SetSTCCursor(-1);
SetSTCCursor(oldCursor);
// adjust the margins to the new DPI
for ( int i = 0; i < SC_MAX_MARGIN; ++i )
{

View File

@@ -963,6 +963,11 @@ void wxStyledTextCtrl::OnGainFocus(wxFocusEvent& evt) {
void wxStyledTextCtrl::OnDPIChanged(wxDPIChangedEvent& evt) {
m_swx->DoInvalidateStyleData();
// trigger a cursor change, so any cursors created by wxWidgets (like reverse arrow) will be recreated
const int oldCursor = GetSTCCursor();
SetSTCCursor(-1);
SetSTCCursor(oldCursor);
// adjust the margins to the new DPI
for ( int i = 0; i < SC_MAX_MARGIN; ++i )
{