fix client area computations and borders rendering if the scrollbars are not inside the border rect
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -720,8 +720,6 @@ void wxWindow::DoGetClientSize(int *width, int *height) const
|
|||||||
if ( m_renderer )
|
if ( m_renderer )
|
||||||
rectBorder = m_renderer->GetBorderDimensions(GetBorder());
|
rectBorder = m_renderer->GetBorderDimensions(GetBorder());
|
||||||
|
|
||||||
bool inside = m_renderer->AreScrollbarsInsideBorder();
|
|
||||||
|
|
||||||
if ( width )
|
if ( width )
|
||||||
{
|
{
|
||||||
#if wxUSE_SCROLLBAR
|
#if wxUSE_SCROLLBAR
|
||||||
@@ -730,17 +728,8 @@ void wxWindow::DoGetClientSize(int *width, int *height) const
|
|||||||
w -= m_scrollbarVert->GetSize().x;
|
w -= m_scrollbarVert->GetSize().x;
|
||||||
#endif // wxUSE_SCROLLBAR
|
#endif // wxUSE_SCROLLBAR
|
||||||
|
|
||||||
// if we don't have scrollbar or if it is outside the border (and not
|
// account for the left and right borders
|
||||||
// blended into it), take account of the right border as well
|
*width = w - rectBorder.x - rectBorder.width;
|
||||||
if (
|
|
||||||
#if wxUSE_SCROLLBAR
|
|
||||||
!m_scrollbarVert ||
|
|
||||||
#endif // wxUSE_SCROLLBAR
|
|
||||||
inside )
|
|
||||||
w -= rectBorder.width;
|
|
||||||
|
|
||||||
// and always account for the left border
|
|
||||||
*width = w - rectBorder.x;
|
|
||||||
|
|
||||||
// we shouldn't return invalid width
|
// we shouldn't return invalid width
|
||||||
if ( *width < 0 )
|
if ( *width < 0 )
|
||||||
@@ -754,14 +743,7 @@ void wxWindow::DoGetClientSize(int *width, int *height) const
|
|||||||
h -= m_scrollbarHorz->GetSize().y;
|
h -= m_scrollbarHorz->GetSize().y;
|
||||||
#endif // wxUSE_SCROLLBAR
|
#endif // wxUSE_SCROLLBAR
|
||||||
|
|
||||||
if (
|
*height = h - rectBorder.y - rectBorder.height;
|
||||||
#if wxUSE_SCROLLBAR
|
|
||||||
!m_scrollbarHorz ||
|
|
||||||
#endif // wxUSE_SCROLLBAR
|
|
||||||
inside )
|
|
||||||
h -= rectBorder.height;
|
|
||||||
|
|
||||||
*height = h - rectBorder.y;
|
|
||||||
|
|
||||||
// we shouldn't return invalid height
|
// we shouldn't return invalid height
|
||||||
if ( *height < 0 )
|
if ( *height < 0 )
|
||||||
@@ -779,29 +761,18 @@ void wxWindow::DoSetClientSize(int width, int height)
|
|||||||
// and the scrollbars (as they may be offset into the border, use the
|
// and the scrollbars (as they may be offset into the border, use the
|
||||||
// scrollbar position, not size - this supposes that PositionScrollbars()
|
// scrollbar position, not size - this supposes that PositionScrollbars()
|
||||||
// had been called before)
|
// had been called before)
|
||||||
bool inside = m_renderer->AreScrollbarsInsideBorder();
|
|
||||||
wxSize size = GetSize();
|
wxSize size = GetSize();
|
||||||
#if wxUSE_SCROLLBAR
|
#if wxUSE_SCROLLBAR
|
||||||
if ( m_scrollbarVert )
|
if ( m_scrollbarVert )
|
||||||
width += size.x - m_scrollbarVert->GetPosition().x;
|
width += size.x - m_scrollbarVert->GetPosition().x;
|
||||||
#endif // wxUSE_SCROLLBAR
|
#endif // wxUSE_SCROLLBAR
|
||||||
if (
|
width += rectBorder.width;
|
||||||
#if wxUSE_SCROLLBAR
|
|
||||||
!m_scrollbarVert ||
|
|
||||||
#endif // wxUSE_SCROLLBAR
|
|
||||||
inside )
|
|
||||||
width += rectBorder.width;
|
|
||||||
|
|
||||||
#if wxUSE_SCROLLBAR
|
#if wxUSE_SCROLLBAR
|
||||||
if ( m_scrollbarHorz )
|
if ( m_scrollbarHorz )
|
||||||
height += size.y - m_scrollbarHorz->GetPosition().y;
|
height += size.y - m_scrollbarHorz->GetPosition().y;
|
||||||
#endif // wxUSE_SCROLLBAR
|
#endif // wxUSE_SCROLLBAR
|
||||||
if (
|
height += rectBorder.height;
|
||||||
#if wxUSE_SCROLLBAR
|
|
||||||
!m_scrollbarHorz ||
|
|
||||||
#endif // wxUSE_SCROLLBAR
|
|
||||||
inside )
|
|
||||||
height += rectBorder.height;
|
|
||||||
|
|
||||||
wxWindowNative::DoSetClientSize(width, height);
|
wxWindowNative::DoSetClientSize(width, height);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user