diff --git a/ZRCola/stdafx.h b/ZRCola/stdafx.h index d05ed05..55eda3b 100644 --- a/ZRCola/stdafx.h +++ b/ZRCola/stdafx.h @@ -40,6 +40,7 @@ #include #include +#include #include #include #include diff --git a/ZRCola/zrcolacomppnl.cpp b/ZRCola/zrcolacomppnl.cpp index 6503673..e9701ff 100644 --- a/ZRCola/zrcolacomppnl.cpp +++ b/ZRCola/zrcolacomppnl.cpp @@ -411,10 +411,11 @@ wxString wxPersistentZRColaComposerPanel::GetKind() const void wxPersistentZRColaComposerPanel::Save() const { - auto const wnd = static_cast(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor. + auto wnd = static_cast(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor. - SaveValue(wxT("splitDecomposed"), wnd->m_splitterSource->GetSashPosition()); - SaveValue(wxT("splitComposed" ), wnd->m_splitterDestination ->GetSashPosition()); + SaveValue(wxT("dpiX" ), wxClientDC(wnd).GetPPI().x); + SaveValue(wxT("splitDecomposed"), wnd->m_splitterSource ->GetSashPosition()); + SaveValue(wxT("splitComposed" ), wnd->m_splitterDestination->GetSashPosition()); } @@ -422,18 +423,23 @@ bool wxPersistentZRColaComposerPanel::Restore() { auto wnd = dynamic_cast(GetWindow()); + int dpiHorz = wxClientDC(wnd).GetPPI().x; + int dpiHorzVal; int sashVal; + if (!RestoreValue(wxT("dpiX"), &dpiHorzVal)) + dpiHorzVal = 96; + if (RestoreValue(wxT("splitDecomposed"), &sashVal)) { // wxFormBuilder sets initial splitter stash in idle event handler after GUI settles. Overriding our loaded value. Disconnect it's idle event handler. wnd->m_splitterSource->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterSourceOnIdle ), NULL, wnd ); - wnd->m_splitterSource->SetSashPosition(sashVal); + wnd->m_splitterSource->SetSashPosition(wxMulDivInt32(sashVal, dpiHorz, dpiHorzVal)); } if (RestoreValue(wxT("splitComposed"), &sashVal)) { // wxFormBuilder sets initial splitter stash in idle event handler after GUI settles. Overriding our loaded value. Disconnect it's idle event handler. wnd->m_splitterDestination->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDestinationOnIdle ), NULL, wnd ); - wnd->m_splitterDestination->SetSashPosition(sashVal); + wnd->m_splitterDestination->SetSashPosition(wxMulDivInt32(sashVal, dpiHorz, dpiHorzVal)); } return true; diff --git a/lib/wxExtend b/lib/wxExtend index 5a912eb..704b979 160000 --- a/lib/wxExtend +++ b/lib/wxExtend @@ -1 +1 @@ -Subproject commit 5a912ebcc6d5d2887628387eae7fc5c8105d7938 +Subproject commit 704b97944d41ca8e1dbcdc45a87bff58bc746caf