Handle DPI change in wxSplitterWindow

This commit is contained in:
Maarten Bent
2022-03-16 18:56:05 +01:00
parent 9285d61393
commit 657be8b6dc
6 changed files with 2 additions and 32 deletions

View File

@@ -297,7 +297,6 @@ protected:
bool m_needUpdating:1;
bool m_permitUnsplitAlways:1;
bool m_isHot:1;
bool m_sizeAfterDPIChange:1;
private:
wxDECLARE_DYNAMIC_CLASS(wxSplitterWindow);

View File

@@ -24,7 +24,6 @@ public:
virtual bool Reparent(wxWindowBase* newParent) wxOVERRIDE;
virtual bool IsThisEnabled() const wxOVERRIDE;
virtual bool IsDPIChanging() const wxOVERRIDE;
protected:
virtual bool DoClearShape() wxOVERRIDE;
@@ -51,9 +50,6 @@ private:
// application manifest contains <dpiAwareness>PerMonitorV2</dpiAwareness>.
bool m_perMonitorDPIaware;
// Set to true while a window is being updated after a DPI change.
bool m_dpiChanging;
wxDECLARE_NO_COPY_CLASS(wxNonOwnedWindow);
};

View File

@@ -664,9 +664,6 @@ public:
// window state)
virtual bool IsThisEnabled() const { return m_isEnabled; }
// returns true while a window is being updated after a DPI change
virtual bool IsDPIChanging() const { return false; }
// returns true if the window is visible, i.e. IsShown() returns true
// if called on it and all its parents up to the first TLW
virtual bool IsShownOnScreen() const;

View File

@@ -1296,16 +1296,6 @@ public:
static int ToPhys(int d, const wxWindow* w);
/**
Returns @true while a window is being updated after a DPI change.
@remarks This function is currently only used under MSW.
@since 3.1.6
*/
bool IsDPIChanging() const;
/**
This functions returns the best acceptable minimal size for the window.

View File

@@ -474,12 +474,6 @@ void wxSplitterWindow::OnSize(wxSizeEvent& event)
// Apply gravity if we use it.
int delta = (int) ( (size - old_size)*m_sashGravity );
if ( winTop && winTop->IsDPIChanging() )
{
// Keep the same relative position.
delta = wxMulDivInt32(size, m_sashPosition, old_size) - m_sashPosition;
}
// If delta == 0 then sash will be set according to the windows min size.
if ( delta != 0 )
{
@@ -530,6 +524,8 @@ void wxSplitterWindow::OnSize(wxSizeEvent& event)
void wxSplitterWindow::OnDPIChanged(wxDPIChangedEvent& event)
{
m_minimumPaneSize = event.ScaleX(m_minimumPaneSize);
m_sashPosition = event.ScaleX(m_sashPosition);
m_lastSize = event.Scale(m_lastSize);
event.Skip();
}

View File

@@ -143,7 +143,6 @@ wxNonOwnedWindow::wxNonOwnedWindow()
m_shapeImpl = NULL;
#endif // wxUSE_GRAPHICS_CONTEXT
m_dpiChanging = false;
m_activeDPI = wxDefaultSize;
m_perMonitorDPIaware = false;
}
@@ -229,11 +228,6 @@ bool wxNonOwnedWindow::IsThisEnabled() const
: m_isEnabled;
}
bool wxNonOwnedWindow::IsDPIChanging() const
{
return m_dpiChanging;
}
WXLRESULT wxNonOwnedWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
WXLRESULT rc = 0;
@@ -256,11 +250,9 @@ WXLRESULT wxNonOwnedWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPA
const RECT* const prcNewWindow =
reinterpret_cast<const RECT*>(lParam);
m_dpiChanging = true;
processed = HandleDPIChange(wxSize(LOWORD(wParam),
HIWORD(wParam)),
wxRectFromRECT(*prcNewWindow));
m_dpiChanging = false;
}
break;
}