package daemon: ProblemWindow: Simplify getting the font height

This commit is contained in:
Ingo Weinhold 2013-09-11 13:39:58 +02:00
parent c159d0cfd1
commit 9f12d254b1

View File

@ -93,10 +93,8 @@ ProblemWindow::ProblemWindow()
viewPort->SetChildView(fContainerView = new BGroupView(B_VERTICAL, 0)); viewPort->SetChildView(fContainerView = new BGroupView(B_VERTICAL, 0));
// set small scroll step (large step will be set by the view port) // set small scroll step (large step will be set by the view port)
BFont font;
topTextView->GetFont(&font);
font_height fontHeight; font_height fontHeight;
font.GetHeight(&fontHeight); topTextView->GetFontHeight(&fontHeight);
float smallStep = ceilf(fontHeight.ascent + fontHeight.descent); float smallStep = ceilf(fontHeight.ascent + fontHeight.descent);
viewPort->ScrollBar(B_VERTICAL)->SetSteps(smallStep, smallStep); viewPort->ScrollBar(B_VERTICAL)->SetSteps(smallStep, smallStep);
} }