correct CalcSizeFromPage() for multiline notebooks (#2335)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -653,16 +653,18 @@ wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
|
|||||||
tabSize.y = rect.bottom - rect.top;
|
tabSize.y = rect.bottom - rect.top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const int rows = GetRowCount();
|
||||||
|
|
||||||
// add an extra margin in both directions
|
// add an extra margin in both directions
|
||||||
const int MARGIN = 8;
|
const int MARGIN = 8;
|
||||||
if ( IsVertical() )
|
if ( IsVertical() )
|
||||||
{
|
{
|
||||||
sizeTotal.x += MARGIN;
|
sizeTotal.x += MARGIN;
|
||||||
sizeTotal.y += tabSize.y + MARGIN;
|
sizeTotal.y += tabSize.y * rows + MARGIN;
|
||||||
}
|
}
|
||||||
else // horizontal layout
|
else // horizontal layout
|
||||||
{
|
{
|
||||||
sizeTotal.x += tabSize.x + MARGIN;
|
sizeTotal.x += tabSize.x * rows + MARGIN;
|
||||||
sizeTotal.y += MARGIN;
|
sizeTotal.y += MARGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1026,6 +1028,10 @@ void wxNotebook::OnSize(wxSizeEvent& event)
|
|||||||
MAKELPARAM(rc.right, rc.bottom));
|
MAKELPARAM(rc.right, rc.bottom));
|
||||||
s_isInOnSize = false;
|
s_isInOnSize = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The best size depends on the number of rows of tabs, which can
|
||||||
|
// change when the notepad is resized.
|
||||||
|
InvalidateBestSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_UXTHEME
|
#if wxUSE_UXTHEME
|
||||||
|
Reference in New Issue
Block a user