Applied patch from Bek of the HOST team: allow the Terminal to be resized
to one line. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22236 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -141,6 +141,8 @@ enum{
|
|||||||
|
|
||||||
#define MIN_COLS 10
|
#define MIN_COLS 10
|
||||||
#define MAX_COLS 256
|
#define MAX_COLS 256
|
||||||
|
#define MIN_ROWS 1
|
||||||
|
#define MAX_ROWS 256
|
||||||
|
|
||||||
// Insert mode flag
|
// Insert mode flag
|
||||||
#define MODE_OVER 0
|
#define MODE_OVER 0
|
||||||
|
|||||||
@@ -389,8 +389,14 @@ TermWindow::MessageReceived(BMessage *message)
|
|||||||
int width, height;
|
int width, height;
|
||||||
_ActiveTermView()->GetFontSize(&width, &height);
|
_ActiveTermView()->GetFontSize(&width, &height);
|
||||||
|
|
||||||
|
float minimumHeight = 0;
|
||||||
|
if (fMenubar)
|
||||||
|
minimumHeight += fMenubar->Bounds().Height();
|
||||||
|
if (fTabView && fTabView->CountTabs() > 1)
|
||||||
|
minimumHeight += fTabView->TabHeight();
|
||||||
SetSizeLimits (MIN_COLS * width, MAX_COLS * width,
|
SetSizeLimits (MIN_COLS * width, MAX_COLS * width,
|
||||||
MIN_COLS * height, MAX_COLS * height);
|
minimumHeight + MIN_ROWS * height,
|
||||||
|
minimumHeight + MAX_ROWS * height);
|
||||||
|
|
||||||
ResizeTo(rect.Width()+ B_V_SCROLL_BAR_WIDTH + kViewOffset * 2,
|
ResizeTo(rect.Width()+ B_V_SCROLL_BAR_WIDTH + kViewOffset * 2,
|
||||||
rect.Height()+fMenubar->Bounds().Height() + kViewOffset * 2);
|
rect.Height()+fMenubar->Bounds().Height() + kViewOffset * 2);
|
||||||
@@ -623,13 +629,22 @@ TermWindow::_AddTab(Arguments *args)
|
|||||||
|
|
||||||
_SetTermColors(view);
|
_SetTermColors(view);
|
||||||
|
|
||||||
// If it's the first time we're called, setup the window
|
if (fTabView->CountTabs() >= 1) {
|
||||||
if (fTabView->CountTabs() == 1) {
|
|
||||||
int width, height;
|
int width, height;
|
||||||
view->GetFontSize(&width, &height);
|
view->GetFontSize(&width, &height);
|
||||||
SetSizeLimits(MIN_COLS * width, MAX_COLS * width,
|
|
||||||
MIN_COLS * height, MAX_COLS * height);
|
float minimumHeight = 0;
|
||||||
|
if (fMenubar)
|
||||||
|
minimumHeight += fMenubar->Bounds().Height();
|
||||||
|
if (fTabView && fTabView->CountTabs() > 1)
|
||||||
|
minimumHeight += fTabView->TabHeight();
|
||||||
|
SetSizeLimits (MIN_COLS * width, MAX_COLS * width,
|
||||||
|
minimumHeight + MIN_ROWS * height,
|
||||||
|
minimumHeight + MAX_ROWS * height);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If it's the first time we're called, setup the window
|
||||||
|
if (fTabView->CountTabs() == 1) {
|
||||||
float fWidth, fHeight;
|
float fWidth, fHeight;
|
||||||
view->GetPreferredSize(&fWidth, &fHeight);
|
view->GetPreferredSize(&fWidth, &fHeight);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user