Fix adjusting position of wxPGProperty editor
Position of the editor should be adjusted after setting new virtual size because this operation can scroll wxPropertyGrid contents and scroll position needs to be taken into account. See #22428.
This commit is contained in:
@@ -4558,11 +4558,7 @@ void wxPropertyGrid::RecalculateVirtualSize( int forceXPos )
|
|||||||
!m_pState )
|
!m_pState )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//
|
int h0 = m_pState->m_virtualHeight;
|
||||||
// If virtual height was changed, then recalculate editor control position(s)
|
|
||||||
if ( m_pState->m_vhCalcPending )
|
|
||||||
CorrectEditorWidgetPosY();
|
|
||||||
|
|
||||||
m_pState->EnsureVirtualHeight();
|
m_pState->EnsureVirtualHeight();
|
||||||
|
|
||||||
wxASSERT_LEVEL_2_MSG(
|
wxASSERT_LEVEL_2_MSG(
|
||||||
@@ -4576,6 +4572,11 @@ void wxPropertyGrid::RecalculateVirtualSize( int forceXPos )
|
|||||||
int h = m_pState->m_virtualHeight;
|
int h = m_pState->m_virtualHeight;
|
||||||
// Now adjust virtual size.
|
// Now adjust virtual size.
|
||||||
SetVirtualSize(w, h);
|
SetVirtualSize(w, h);
|
||||||
|
// If virtual height was changed, then recalculate editor control position(s)
|
||||||
|
if ( h != h0 )
|
||||||
|
{
|
||||||
|
CorrectEditorWidgetPosY();
|
||||||
|
}
|
||||||
if ( forceXPos != -1 )
|
if ( forceXPos != -1 )
|
||||||
{
|
{
|
||||||
Scroll(forceXPos, wxDefaultCoord);
|
Scroll(forceXPos, wxDefaultCoord);
|
||||||
|
|||||||
Reference in New Issue
Block a user