From 51ff40fed0e4b1947c13294fb74706fe59241944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Fri, 13 Mar 2009 20:18:01 +0000 Subject: [PATCH] When adding/removing the second tab, check if the window is near the bottom of the screen, and then move/resize the window upward, so that it's bottom doesn't go beyond the screen border. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29496 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/terminal/SmartTabView.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/apps/terminal/SmartTabView.cpp b/src/apps/terminal/SmartTabView.cpp index 81bec44ac1..ceba3c3bea 100644 --- a/src/apps/terminal/SmartTabView.cpp +++ b/src/apps/terminal/SmartTabView.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2007, Haiku. All rights reserved. + * Copyright 2007-2009, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -160,6 +161,11 @@ SmartTabView::AddTab(BView *target, BTab *tab) // switching from "normal" to tabbed mode ContainerView()->ResizeBy(0, -TabHeight()); ContainerView()->MoveBy(0, TabHeight()); + + BScreen screen(Window()); + if (Window()->Frame().bottom + TabHeight() > screen.Frame().bottom - 5) + Window()->MoveBy(0, -TabHeight()); + Window()->ResizeBy(0, TabHeight()); } @@ -172,6 +178,9 @@ SmartTabView::RemoveTab(int32 index) { if (CountTabs() == 2) { // see above + BScreen screen(Window()); + if (Window()->Frame().bottom > screen.Frame().bottom - 5 - TabHeight()) + Window()->MoveBy(0, TabHeight()); Window()->ResizeBy(0, -TabHeight()); ContainerView()->MoveBy(0, -TabHeight()); ContainerView()->ResizeBy(0, TabHeight());