Update wxHtmlWindow on DPI change
This is not ideal, as resetting the page contents loses the current selection and redoes a lot of work that could be avoided, but it's (much) better than nothing, as it fixes the window appearance after e.g. moving it to another monitor. Closes #18564.
This commit is contained in:
committed by
Vadim Zeitlin
parent
39ca664053
commit
bdc18f68b6
@@ -405,6 +405,7 @@ protected:
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnDPIChanged(wxDPIChangedEvent& event);
|
||||
void OnMouseMove(wxMouseEvent& event);
|
||||
void OnMouseDown(wxMouseEvent& event);
|
||||
void OnMouseUp(wxMouseEvent& event);
|
||||
|
@@ -1319,6 +1319,10 @@ void wxHtmlWindow::OnSize(wxSizeEvent& event)
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void wxHtmlWindow::OnDPIChanged(wxDPIChangedEvent& WXUNUSED(event))
|
||||
{
|
||||
DoSetPage(*(m_Parser->GetSource()));
|
||||
}
|
||||
|
||||
void wxHtmlWindow::OnMouseMove(wxMouseEvent& WXUNUSED(event))
|
||||
{
|
||||
@@ -1761,6 +1765,7 @@ wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxHtmlWindow, wxScrolledWindow, "wx/html/htmlwin.h
|
||||
|
||||
wxBEGIN_EVENT_TABLE(wxHtmlWindow, wxScrolledWindow)
|
||||
EVT_SIZE(wxHtmlWindow::OnSize)
|
||||
EVT_DPI_CHANGED(wxHtmlWindow::OnDPIChanged)
|
||||
EVT_LEFT_DOWN(wxHtmlWindow::OnMouseDown)
|
||||
EVT_LEFT_UP(wxHtmlWindow::OnMouseUp)
|
||||
EVT_RIGHT_UP(wxHtmlWindow::OnMouseUp)
|
||||
|
Reference in New Issue
Block a user