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:
parent
bfc8f93366
commit
16c9d63da6
1 changed files with 11 additions and 0 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue