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:
@@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <Messenger.h>
|
#include <Messenger.h>
|
||||||
#include <PopUpMenu.h>
|
#include <PopUpMenu.h>
|
||||||
|
#include <Screen.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -160,6 +161,11 @@ SmartTabView::AddTab(BView *target, BTab *tab)
|
|||||||
// switching from "normal" to tabbed mode
|
// switching from "normal" to tabbed mode
|
||||||
ContainerView()->ResizeBy(0, -TabHeight());
|
ContainerView()->ResizeBy(0, -TabHeight());
|
||||||
ContainerView()->MoveBy(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());
|
Window()->ResizeBy(0, TabHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,6 +178,9 @@ SmartTabView::RemoveTab(int32 index)
|
|||||||
{
|
{
|
||||||
if (CountTabs() == 2) {
|
if (CountTabs() == 2) {
|
||||||
// see above
|
// see above
|
||||||
|
BScreen screen(Window());
|
||||||
|
if (Window()->Frame().bottom > screen.Frame().bottom - 5 - TabHeight())
|
||||||
|
Window()->MoveBy(0, TabHeight());
|
||||||
Window()->ResizeBy(0, -TabHeight());
|
Window()->ResizeBy(0, -TabHeight());
|
||||||
ContainerView()->MoveBy(0, -TabHeight());
|
ContainerView()->MoveBy(0, -TabHeight());
|
||||||
ContainerView()->ResizeBy(0, TabHeight());
|
ContainerView()->ResizeBy(0, TabHeight());
|
||||||
|
|||||||
Reference in New Issue
Block a user