Also set the scrollbar steps when the terminal size changes.
Moved SetFlags() from _InitObject() to unarchiving constructor as other constructors already set the flags. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23914 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
1d7596167d
commit
032f765603
@ -235,6 +235,9 @@ TermView::TermView(BMessage *archive)
|
||||
if (archive->FindInt32("rows", (int32 *)&fTermRows) < B_OK)
|
||||
fTermRows = ROWS_DEFAULT;
|
||||
|
||||
// We need this
|
||||
SetFlags(Flags() | B_WILL_DRAW | B_PULSE_NEEDED);
|
||||
|
||||
// TODO: Retrieve arguments, colors, history size, etc. from archive
|
||||
_InitObject(0, NULL);
|
||||
}
|
||||
@ -266,8 +269,6 @@ TermView::_InitObject(int32 argc, const char **argv)
|
||||
if (status < B_OK)
|
||||
return status;
|
||||
|
||||
// We need this
|
||||
SetFlags(Flags() | B_WILL_DRAW | B_PULSE_NEEDED);
|
||||
|
||||
SetLowColor(fTextBackColor);
|
||||
SetViewColor(fTextBackColor);
|
||||
@ -364,6 +365,9 @@ TermView::SetTermSize(int rows, int cols, bool resize)
|
||||
if (resize)
|
||||
ResizeTo(rect.Width(), rect.Height());
|
||||
|
||||
if (fScrollBar != NULL)
|
||||
fScrollBar->SetSteps(fFontHeight, fFontHeight * fTermRows);
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
@ -424,7 +428,6 @@ TermView::GetTermFont(BFont *font) const
|
||||
void
|
||||
TermView::SetTermFont(const BFont *font)
|
||||
{
|
||||
char buf[4];
|
||||
int halfWidth = 0;
|
||||
|
||||
fHalfFont = font;
|
||||
@ -434,6 +437,7 @@ TermView::SetTermFont(const BFont *font)
|
||||
// calculate half font's max width
|
||||
// Not Bounding, check only A-Z(For case of fHalfFont is KanjiFont. )
|
||||
for (int c = 0x20 ; c <= 0x7e; c++){
|
||||
char buf[4];
|
||||
sprintf(buf, "%c", c);
|
||||
int tmpWidth = (int)fHalfFont.StringWidth(buf);
|
||||
if (tmpWidth > halfWidth)
|
||||
|
Loading…
Reference in New Issue
Block a user