Small tweaks regarding the scrollbars of terminal when used in fullscreen mode :

* if there is only one tab open, no functional change
* when there is two or more tabs open, display the scroll bar in the _ActiveTermView

It simply didn't make sense to not display the scrollbars in the _ActiveTermView since it was already shown in the other tabs. On the other hand, I can understand not showing the scrollbar when there is no tabview visible, as it mimic a real terminal.

That fixes bug reported in ticket #3300.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30597 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Saint-Pierre
2009-05-03 03:23:17 +00:00
parent a7ed06cedd
commit ffcedfaa29
2 changed files with 19 additions and 6 deletions
+15 -4
View File
@@ -152,7 +152,8 @@ TermWindow::TermWindow(BRect frame, const char* title, Arguments *args)
fFindSelection(false), fFindSelection(false),
fForwardSearch(false), fForwardSearch(false),
fMatchCase(false), fMatchCase(false),
fMatchWord(false) fMatchWord(false),
fFullScreen(false)
{ {
_InitWindow(); _InitWindow();
_AddTab(args); _AddTab(args);
@@ -486,7 +487,9 @@ TermWindow::MessageReceived(BMessage *message)
float mbHeight = fMenubar->Bounds().Height() + 1; float mbHeight = fMenubar->Bounds().Height() + 1;
fSavedFrame = Frame(); fSavedFrame = Frame();
BScreen screen(this); BScreen screen(this);
_ActiveTermView()->ScrollBar()->Hide(); if (fTabView->CountTabs() == 1)
_ActiveTermView()->ScrollBar()->Hide();
fMenubar->Hide(); fMenubar->Hide();
fTabView->ResizeBy(0, mbHeight); fTabView->ResizeBy(0, mbHeight);
fTabView->MoveBy(0, -mbHeight); fTabView->MoveBy(0, -mbHeight);
@@ -495,6 +498,7 @@ TermWindow::MessageReceived(BMessage *message)
SetLook(B_NO_BORDER_WINDOW_LOOK); SetLook(B_NO_BORDER_WINDOW_LOOK);
ResizeTo(screen.Frame().Width()+1, screen.Frame().Height()+1); ResizeTo(screen.Frame().Width()+1, screen.Frame().Height()+1);
MoveTo(screen.Frame().left, screen.Frame().top); MoveTo(screen.Frame().left, screen.Frame().top);
fFullScreen = true;
} else { // exit fullscreen } else { // exit fullscreen
_ActiveTermView()->DisableResizeView(); _ActiveTermView()->DisableResizeView();
float mbHeight = fMenubar->Bounds().Height() + 1; float mbHeight = fMenubar->Bounds().Height() + 1;
@@ -506,6 +510,7 @@ TermWindow::MessageReceived(BMessage *message)
fTabView->MoveBy(0, mbHeight); fTabView->MoveBy(0, mbHeight);
SetLook(fSavedLook); SetLook(fSavedLook);
fSavedFrame = BRect(0,0,-1,-1); fSavedFrame = BRect(0,0,-1,-1);
fFullScreen = false;
} }
break; break;
@@ -565,8 +570,11 @@ TermWindow::MessageReceived(BMessage *message)
} }
case kNewTab: case kNewTab:
if (fTabView->CountTabs() < kMaxTabs) if (fTabView->CountTabs() < kMaxTabs) {
if (fFullScreen)
_ActiveTermView()->ScrollBar()->Show();
_AddTab(NULL); _AddTab(NULL);
}
break; break;
case kCloseView: case kCloseView:
@@ -574,8 +582,9 @@ TermWindow::MessageReceived(BMessage *message)
TermView* termView; TermView* termView;
if (message->FindPointer("termView", (void**)&termView) == B_OK) { if (message->FindPointer("termView", (void**)&termView) == B_OK) {
int32 index = _IndexOfTermView(termView); int32 index = _IndexOfTermView(termView);
if (index >= 0) if (index >= 0) {
_RemoveTab(index); _RemoveTab(index);
}
} }
break; break;
} }
@@ -783,6 +792,8 @@ TermWindow::_RemoveTab(int32 index)
if (Session* session = (Session*)fSessions.RemoveItem(index)) { if (Session* session = (Session*)fSessions.RemoveItem(index)) {
delete session; delete session;
delete fTabView->RemoveTab(index); delete fTabView->RemoveTab(index);
if (fFullScreen)
_ActiveTermView()->ScrollBar()->Hide();
} }
} else } else
PostMessage(B_QUIT_REQUESTED); PostMessage(B_QUIT_REQUESTED);
+2
View File
@@ -111,6 +111,8 @@ private:
bool fForwardSearch; bool fForwardSearch;
bool fMatchCase; bool fMatchCase;
bool fMatchWord; bool fMatchWord;
bool fFullScreen;
}; };
#endif // __TERMWINDOW_H #endif // __TERMWINDOW_H