Set the listbox height to an integer multiple of the listbox entry height.

This ensures that we don't get a half visible entry at the bottom of the view.

Signed-off-by: Tor Lillqvist <tlillqvist@novell.com>
This commit is contained in:
Luke Symes 2011-06-22 15:40:26 +12:00 committed by Tor Lillqvist
parent bfc8f93366
commit 16c9d63da6

View file

@ -1358,8 +1358,19 @@ void SvImpLBox::InitScrollBarBox()
void SvImpLBox::Resize()
{
Size aSize( pView->Control::GetOutputSizePixel());
long nEntryHeight = pView->GetEntryHeight();
int nEntryCount = 0;
if( aSize.Width() <= 0 || aSize.Height() <= 0 )
return;
if( nEntryHeight )
{
// Set the view height to an integer multiple of the entry height.
nEntryCount = (int) aSize.Height() / nEntryHeight;
aSize.Height() = pView->GetEntryHeight() * nEntryCount;
pView->Control::SetOutputSizePixel( aSize );
}
nFlags |= F_IN_RESIZE;
InitScrollBarBox();