Bug 470711 - Newly modernized tabs look cut off if the last one is hidden, r=josh r+sr=roc

This commit is contained in:
Markus Stange 2009-01-02 22:02:50 +01:00
parent 6aa805f93b
commit 4ccec61031
2 changed files with 13 additions and 2 deletions

View File

@ -264,7 +264,13 @@ nsNativeTheme::IsFirstTab(nsIFrame* aFrame)
if (!aFrame)
return PR_FALSE;
return aFrame->GetContent()->HasAttr(kNameSpaceID_None, nsWidgetAtoms::firsttab);
nsIFrame* first = aFrame->GetParent()->GetFirstChild(nsnull);
while (first) {
if (first->GetRect().width > 0 && first->GetContent()->Tag() == nsWidgetAtoms::tab)
return (first == aFrame);
first = first->GetNextSibling();
}
return PR_FALSE;
}
PRBool
@ -273,7 +279,11 @@ nsNativeTheme::IsLastTab(nsIFrame* aFrame)
if (!aFrame)
return PR_FALSE;
return aFrame->GetContent()->HasAttr(kNameSpaceID_None, nsWidgetAtoms::lasttab);
while ((aFrame = aFrame->GetNextSibling())) {
if (aFrame->GetRect().width > 0 && aFrame->GetContent()->Tag() == nsWidgetAtoms::tab)
return PR_FALSE;
}
return PR_TRUE;
}
PRBool

View File

@ -119,6 +119,7 @@ WIDGET_ATOM(state, "state")
WIDGET_ATOM(step, "step")
WIDGET_ATOM(Stop, "Stop")
WIDGET_ATOM(_true, "true")
WIDGET_ATOM(tab, "tab")
WIDGET_ATOM(tree, "tree")
WIDGET_ATOM(treecolpicker, "treecolpicker")
WIDGET_ATOM(type, "type")