From 80aabca1885c24406561daf703ef59e5750be76b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Tue, 31 Mar 2009 13:37:04 +0000 Subject: [PATCH] When the window is already full screen (ie, zoomed, not the full-screen mode without any window border), do not enlarge or shrink the window when going from or into tabbed mode. Fixes ticket #3646. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29822 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/terminal/SmartTabView.cpp | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/apps/terminal/SmartTabView.cpp b/src/apps/terminal/SmartTabView.cpp index ceba3c3bea..443bf3396f 100644 --- a/src/apps/terminal/SmartTabView.cpp +++ b/src/apps/terminal/SmartTabView.cpp @@ -163,10 +163,15 @@ SmartTabView::AddTab(BView *target, BTab *tab) ContainerView()->MoveBy(0, TabHeight()); BScreen screen(Window()); - if (Window()->Frame().bottom + TabHeight() > screen.Frame().bottom - 5) - Window()->MoveBy(0, -TabHeight()); - - Window()->ResizeBy(0, TabHeight()); + if (Window()->DecoratorFrame().Height() + 2 * TabHeight() + < screen.Frame().Height()) { + if (Window()->Frame().bottom + TabHeight() + > screen.Frame().bottom - 5) { + Window()->MoveBy(0, -TabHeight()); + } + + Window()->ResizeBy(0, TabHeight()); + } } Invalidate(TabFrame(CountTabs() - 1).InsetByCopy(-2, -2)); @@ -177,11 +182,17 @@ BTab * SmartTabView::RemoveTab(int32 index) { if (CountTabs() == 2) { - // see above + // see AddTab() BScreen screen(Window()); - if (Window()->Frame().bottom > screen.Frame().bottom - 5 - TabHeight()) - Window()->MoveBy(0, TabHeight()); - Window()->ResizeBy(0, -TabHeight()); + if (Window()->DecoratorFrame().Height() + 2 * TabHeight() + < screen.Frame().Height()) { + 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()); }