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
This commit is contained in:
Stephan Aßmus
2009-03-13 20:18:01 +00:00
parent 5ea31e66f7
commit 51ff40fed0
+10 -1
View File
@@ -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 <Message.h>
#include <Messenger.h>
#include <PopUpMenu.h>
#include <Screen.h>
#include <Window.h>
#include <stdio.h>
@@ -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());