Account for the fact that the visible frame of a tab is one pixel larger at

the bottom. Will fix Haiku ticket #6383 when a new package is made available.

git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@539 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
stippi 2010-07-26 12:05:26 +00:00 committed by Alexandre Deckner
parent 01abe0e23c
commit e71c5717b1

View File

@ -429,9 +429,14 @@ TabContainerView::_TabAt(const BPoint& where) const
BGroupLayout* layout = GroupLayout();
int32 count = layout->CountItems() - 1;
for (int32 i = 0; i < count; i++) {
TabLayoutItem* item = dynamic_cast<TabLayoutItem*>(
layout->ItemAt(i));
if (item && item->IsVisible() && item->Frame().Contains(where))
TabLayoutItem* item = dynamic_cast<TabLayoutItem*>(layout->ItemAt(i));
if (item == NULL || !item->IsVisible())
continue;
// Account for the fact that the tab frame does not contain the
// visible bottom border.
BRect frame = item->Frame();
frame.bottom++;
if (frame.Contains(where))
return item->Parent();
}
return NULL;