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:
@@ -235,6 +235,9 @@ TermView::TermView(BMessage *archive)
|
|||||||
if (archive->FindInt32("rows", (int32 *)&fTermRows) < B_OK)
|
if (archive->FindInt32("rows", (int32 *)&fTermRows) < B_OK)
|
||||||
fTermRows = ROWS_DEFAULT;
|
fTermRows = ROWS_DEFAULT;
|
||||||
|
|
||||||
|
// We need this
|
||||||
|
SetFlags(Flags() | B_WILL_DRAW | B_PULSE_NEEDED);
|
||||||
|
|
||||||
// TODO: Retrieve arguments, colors, history size, etc. from archive
|
// TODO: Retrieve arguments, colors, history size, etc. from archive
|
||||||
_InitObject(0, NULL);
|
_InitObject(0, NULL);
|
||||||
}
|
}
|
||||||
@@ -266,8 +269,6 @@ TermView::_InitObject(int32 argc, const char **argv)
|
|||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
// We need this
|
|
||||||
SetFlags(Flags() | B_WILL_DRAW | B_PULSE_NEEDED);
|
|
||||||
|
|
||||||
SetLowColor(fTextBackColor);
|
SetLowColor(fTextBackColor);
|
||||||
SetViewColor(fTextBackColor);
|
SetViewColor(fTextBackColor);
|
||||||
@@ -364,6 +365,9 @@ TermView::SetTermSize(int rows, int cols, bool resize)
|
|||||||
if (resize)
|
if (resize)
|
||||||
ResizeTo(rect.Width(), rect.Height());
|
ResizeTo(rect.Width(), rect.Height());
|
||||||
|
|
||||||
|
if (fScrollBar != NULL)
|
||||||
|
fScrollBar->SetSteps(fFontHeight, fFontHeight * fTermRows);
|
||||||
|
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -424,7 +428,6 @@ TermView::GetTermFont(BFont *font) const
|
|||||||
void
|
void
|
||||||
TermView::SetTermFont(const BFont *font)
|
TermView::SetTermFont(const BFont *font)
|
||||||
{
|
{
|
||||||
char buf[4];
|
|
||||||
int halfWidth = 0;
|
int halfWidth = 0;
|
||||||
|
|
||||||
fHalfFont = font;
|
fHalfFont = font;
|
||||||
@@ -434,6 +437,7 @@ TermView::SetTermFont(const BFont *font)
|
|||||||
// calculate half font's max width
|
// calculate half font's max width
|
||||||
// Not Bounding, check only A-Z(For case of fHalfFont is KanjiFont. )
|
// Not Bounding, check only A-Z(For case of fHalfFont is KanjiFont. )
|
||||||
for (int c = 0x20 ; c <= 0x7e; c++){
|
for (int c = 0x20 ; c <= 0x7e; c++){
|
||||||
|
char buf[4];
|
||||||
sprintf(buf, "%c", c);
|
sprintf(buf, "%c", c);
|
||||||
int tmpWidth = (int)fHalfFont.StringWidth(buf);
|
int tmpWidth = (int)fHalfFont.StringWidth(buf);
|
||||||
if (tmpWidth > halfWidth)
|
if (tmpWidth > halfWidth)
|
||||||
|
|||||||
Reference in New Issue
Block a user