From 039be939e679d8017d1582b6272487c5a4375025 Mon Sep 17 00:00:00 2001 From: "evaughan%netscape.com" Date: Fri, 29 Oct 1999 22:13:57 +0000 Subject: [PATCH] Made tabs us visibility instead of shrinking their children to 0,0. Made it possible to change the look for the selected tab. --- editor/ui/dialogs/content/EdAdvancedEdit.xul | 3 +- editor/ui/dialogs/content/EdTableProps.xul | 3 +- .../wallet/cookieviewer/CookieViewer.xul | 3 +- .../wallet/signonviewer/SignonViewer.xul | 3 +- layout/generic/nsGfxScrollFrame.cpp | 4 +- layout/generic/nsGfxScrollFrame.h | 2 +- layout/html/base/src/nsGfxScrollFrame.cpp | 4 +- layout/html/base/src/nsGfxScrollFrame.h | 2 +- layout/html/base/src/nsScrollPortFrame.cpp | 4 +- layout/html/base/src/nsScrollPortFrame.h | 2 +- layout/xul/base/src/nsBoxFrame.cpp | 73 +++++++++--- layout/xul/base/src/nsBoxFrame.h | 7 +- layout/xul/base/src/nsDeckFrame.cpp | 106 ++++++++++++------ layout/xul/base/src/nsDeckFrame.h | 3 + layout/xul/base/src/nsIBox.h | 2 +- layout/xul/base/src/nsMenuFrame.cpp | 6 +- layout/xul/base/src/nsMenuFrame.h | 2 +- layout/xul/base/src/nsPopupSetFrame.cpp | 6 +- layout/xul/base/src/nsPopupSetFrame.h | 2 +- layout/xul/base/src/nsTabFrame.cpp | 43 +++---- layout/xul/base/src/nsTabFrame.h | 20 ++++ layout/xul/base/src/nsTitledButtonFrame.cpp | 2 +- layout/xul/base/src/nsTitledButtonFrame.h | 2 +- .../resources/content/abCardOverlay.xul | 3 +- .../resources/content/createProfileWizard.xul | 5 +- xpfe/browser/samples/tab.xul | 5 +- xpfe/components/search/resources/search.xul | 3 +- xpfe/global/resources/skin/global.css | 7 ++ 28 files changed, 222 insertions(+), 105 deletions(-) diff --git a/editor/ui/dialogs/content/EdAdvancedEdit.xul b/editor/ui/dialogs/content/EdAdvancedEdit.xul index 73f6298c747b..4d02c1df519d 100644 --- a/editor/ui/dialogs/content/EdAdvancedEdit.xul +++ b/editor/ui/dialogs/content/EdAdvancedEdit.xul @@ -56,9 +56,10 @@ - &tabHTML.label; + &tabHTML.label; &tabCSS.label; &tabJSE.label; + diff --git a/editor/ui/dialogs/content/EdTableProps.xul b/editor/ui/dialogs/content/EdTableProps.xul index a6037643b2d8..6fc5bb2b013e 100644 --- a/editor/ui/dialogs/content/EdTableProps.xul +++ b/editor/ui/dialogs/content/EdTableProps.xul @@ -46,8 +46,9 @@ - &tableTab.label; + &tableTab.label; &cellTab.label; + diff --git a/extensions/wallet/cookieviewer/CookieViewer.xul b/extensions/wallet/cookieviewer/CookieViewer.xul index b6591955f0c4..2a8c3c5d699c 100644 --- a/extensions/wallet/cookieviewer/CookieViewer.xul +++ b/extensions/wallet/cookieviewer/CookieViewer.xul @@ -42,8 +42,9 @@ - &tab.cookiesonsystem.label; + &tab.cookiesonsystem.label; &tab.bannedservers.label; + diff --git a/extensions/wallet/signonviewer/SignonViewer.xul b/extensions/wallet/signonviewer/SignonViewer.xul index f96988e9e810..062414817e16 100644 --- a/extensions/wallet/signonviewer/SignonViewer.xul +++ b/extensions/wallet/signonviewer/SignonViewer.xul @@ -43,9 +43,10 @@ - &tab.signonsstored.label; + &tab.signonsstored.label; &tab.signonsnotstored.label; &tab.nopreview.label; + diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 88e0f022a1af..9e58932208cb 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -1668,7 +1668,7 @@ nsBoxFrame::GetRedefinedMinPrefMax(nsIFrame* aFrame, nsBoxInfo& aSize) */ NS_IMETHODIMP -nsGfxScrollFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild) +nsGfxScrollFrame::Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild) { incrementalChild = nsnull; nsresult rv = NS_OK; @@ -1695,7 +1695,7 @@ nsGfxScrollFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& increm if (NS_FAILED(rv)) return rv; - ibox->Dirty(aReflowState, incrementalChild); + ibox->Dirty(aPresContext, aReflowState, incrementalChild); break; } diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index 9eda661abd57..8a96e2ec5111 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -95,7 +95,7 @@ public: // nsIBox methods NS_IMETHOD GetBoxInfo(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsBoxInfo& aSize); - NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild); + NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild); NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); NS_IMETHOD_(nsrefcnt) AddRef(void) { return NS_OK; } NS_IMETHOD_(nsrefcnt) Release(void) { return NS_OK; } diff --git a/layout/html/base/src/nsGfxScrollFrame.cpp b/layout/html/base/src/nsGfxScrollFrame.cpp index 88e0f022a1af..9e58932208cb 100644 --- a/layout/html/base/src/nsGfxScrollFrame.cpp +++ b/layout/html/base/src/nsGfxScrollFrame.cpp @@ -1668,7 +1668,7 @@ nsBoxFrame::GetRedefinedMinPrefMax(nsIFrame* aFrame, nsBoxInfo& aSize) */ NS_IMETHODIMP -nsGfxScrollFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild) +nsGfxScrollFrame::Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild) { incrementalChild = nsnull; nsresult rv = NS_OK; @@ -1695,7 +1695,7 @@ nsGfxScrollFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& increm if (NS_FAILED(rv)) return rv; - ibox->Dirty(aReflowState, incrementalChild); + ibox->Dirty(aPresContext, aReflowState, incrementalChild); break; } diff --git a/layout/html/base/src/nsGfxScrollFrame.h b/layout/html/base/src/nsGfxScrollFrame.h index 9eda661abd57..8a96e2ec5111 100644 --- a/layout/html/base/src/nsGfxScrollFrame.h +++ b/layout/html/base/src/nsGfxScrollFrame.h @@ -95,7 +95,7 @@ public: // nsIBox methods NS_IMETHOD GetBoxInfo(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsBoxInfo& aSize); - NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild); + NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild); NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); NS_IMETHOD_(nsrefcnt) AddRef(void) { return NS_OK; } NS_IMETHOD_(nsrefcnt) Release(void) { return NS_OK; } diff --git a/layout/html/base/src/nsScrollPortFrame.cpp b/layout/html/base/src/nsScrollPortFrame.cpp index 59d0d784e9e4..f19df61a1e27 100644 --- a/layout/html/base/src/nsScrollPortFrame.cpp +++ b/layout/html/base/src/nsScrollPortFrame.cpp @@ -690,7 +690,7 @@ nsScrollPortFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr) } NS_IMETHODIMP -nsScrollPortFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild) +nsScrollPortFrame::Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild) { mIncremental = PR_FALSE; incrementalChild = nsnull; @@ -702,7 +702,7 @@ nsScrollPortFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incre nsIBox* ibox; if (NS_SUCCEEDED(childFrame->QueryInterface(nsIBox::GetIID(), (void**)&ibox)) && ibox) - ibox->Dirty(aReflowState, incrementalChild); + ibox->Dirty(aPresContext, aReflowState, incrementalChild); else { incrementalChild = frame; // if we found a leaf that is not a box. Then mark it as being incremental. So if we are ever diff --git a/layout/html/base/src/nsScrollPortFrame.h b/layout/html/base/src/nsScrollPortFrame.h index 6f3364a33c61..9ed03397043d 100644 --- a/layout/html/base/src/nsScrollPortFrame.h +++ b/layout/html/base/src/nsScrollPortFrame.h @@ -90,7 +90,7 @@ public: // nsIBox methods NS_IMETHOD GetBoxInfo(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsBoxInfo& aSize); - NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild); + NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild); NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); NS_IMETHOD_(nsrefcnt) AddRef(void) { return NS_OK; } NS_IMETHOD_(nsrefcnt) Release(void) { return NS_OK; } diff --git a/layout/xul/base/src/nsBoxFrame.cpp b/layout/xul/base/src/nsBoxFrame.cpp index 77bf52f321b0..37d506060ab4 100644 --- a/layout/xul/base/src/nsBoxFrame.cpp +++ b/layout/xul/base/src/nsBoxFrame.cpp @@ -471,7 +471,7 @@ nsBoxFrame::Reflow(nsIPresContext& aPresContext, Invalidate(&aPresContext, nsRect(0,0,mRect.width,mRect.height), PR_FALSE); } else { // otherwise dirty our children - Dirty(aReflowState,incrementalChild); + Dirty(aPresContext, aReflowState,incrementalChild); } } #if 0 @@ -858,25 +858,29 @@ nsBoxFrame::ChildResized(nsIFrame* aFrame, nsHTMLReflowMetrics& aDesiredSize, ns } } - void -nsBoxFrame::CollapseChild(nsIPresContext* aPresContext, nsIFrame* frame) +nsBoxFrame::CollapseChild(nsIPresContext& aPresContext, nsIFrame* frame, PRBool hide) { - nsRect rect(0,0,0,0); - frame->GetRect(rect); - if (rect.width > 0 || rect.height > 0) { - // shrink the frame - frame->SizeTo(aPresContext, 0,0); - - // shrink the view + // shrink the view nsIView* view = nsnull; - frame->GetView(aPresContext, &view); + frame->GetView(&aPresContext, &view); // if we find a view stop right here. All views under it // will be clipped. if (view) { - view->SetDimensions(0,0,PR_FALSE); - return; + nsViewVisibility v; + view->GetVisibility(v); + nsCOMPtr widget; + view->GetWidget(*getter_AddRefs(widget)); + if (hide) { + view->SetVisibility(nsViewVisibility_kHide); + } else { + view->SetVisibility(nsViewVisibility_kShow); + } + if (widget) { + + return; + } } // collapse the child @@ -885,13 +889,35 @@ nsBoxFrame::CollapseChild(nsIPresContext* aPresContext, nsIFrame* frame) while (nsnull != child) { - CollapseChild(aPresContext, child); + CollapseChild(aPresContext, child, hide); nsresult rv = child->GetNextSibling(&child); NS_ASSERTION(rv == NS_OK,"failed to get next child"); } - } } +NS_IMETHODIMP +nsBoxFrame::DidReflow(nsIPresContext& aPresContext, + nsDidReflowStatus aStatus) +{ + nsresult rv = nsHTMLContainerFrame::DidReflow(aPresContext, aStatus); + NS_ASSERTION(rv == NS_OK,"DidReflow failed"); + + nsIFrame* childFrame = mFrames.FirstChild(); + nscoord count = 0; + while (nsnull != childFrame) + { + // make collapsed children not show up + if (mSprings[count].collapsed) { + CollapseChild(aPresContext, childFrame, PR_TRUE); + } + + rv = childFrame->GetNextSibling(&childFrame); + NS_ASSERTION(rv == NS_OK,"failed to get next child"); + count++; + } + + return rv; +} /** * Given the boxes rect. Set the x,y locations of all its children. Taking into account @@ -912,7 +938,11 @@ nsBoxFrame::PlaceChildren(nsIPresContext& aPresContext, nsRect& boxRect) // make collapsed children not show up if (mSprings[count].collapsed) { - CollapseChild(&aPresContext, childFrame); + nsRect rect(0,0,0,0); + childFrame->GetRect(rect); + if (rect.width > 0 || rect.height > 0) { + childFrame->SizeTo(&aPresContext, 0,0); + } } else { const nsStyleSpacing* spacing; rv = childFrame->GetStyleData(eStyleStruct_Spacing, @@ -1605,8 +1635,15 @@ nsBoxFrame::AddChildSize(nsBoxInfo& aInfo, nsBoxInfo& aChildInfo) * will be flowed incrementally. */ NS_IMETHODIMP -nsBoxFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild) +nsBoxFrame::Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild) { + nsIFrame* targetFrame = nsnull; + aReflowState.reflowCommand->GetTarget(targetFrame); + if (this == targetFrame) { + // if it has redraw us if we are the target + Invalidate(&aPresContext, nsRect(0,0,mRect.width,mRect.height), PR_FALSE); + } + incrementalChild = nsnull; nsresult rv = NS_OK; @@ -1625,7 +1662,7 @@ nsBoxFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalC // can't use nsCOMPtr on non-refcounted things like frames nsIBox* ibox; if (NS_SUCCEEDED(childFrame->QueryInterface(nsIBox::GetIID(), (void**)&ibox)) && ibox) - ibox->Dirty(aReflowState, incrementalChild); + ibox->Dirty(aPresContext, aReflowState, incrementalChild); else incrementalChild = frame; diff --git a/layout/xul/base/src/nsBoxFrame.h b/layout/xul/base/src/nsBoxFrame.h index 7400e8d5d941..0f0728cc8552 100644 --- a/layout/xul/base/src/nsBoxFrame.h +++ b/layout/xul/base/src/nsBoxFrame.h @@ -75,10 +75,13 @@ public: // nsIBox methods NS_IMETHOD GetBoxInfo(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsBoxInfo& aSize); - NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild); + NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild); NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); + NS_IMETHOD DidReflow(nsIPresContext& aPresContext, + nsDidReflowStatus aStatus); + NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, @@ -171,7 +174,7 @@ protected: virtual PRIntn GetSkipSides() const { return 0; } virtual void GetInset(nsMargin& margin); - virtual void CollapseChild(nsIPresContext* aPresContext, nsIFrame* frame); + virtual void CollapseChild(nsIPresContext& aPresContext, nsIFrame* frame, PRBool hide); nsresult GenerateDirtyReflowCommand(nsIPresContext& aPresContext, nsIPresShell& aPresShell); diff --git a/layout/xul/base/src/nsDeckFrame.cpp b/layout/xul/base/src/nsDeckFrame.cpp index 28176628acd4..36b3c7e86d87 100644 --- a/layout/xul/base/src/nsDeckFrame.cpp +++ b/layout/xul/base/src/nsDeckFrame.cpp @@ -85,6 +85,7 @@ nsDeckFrame::AttributeChanged(nsIPresContext* aPresContext, // if the index changed hide the old element and make the now element visible if (aAttribute == nsHTMLAtoms::index) { + /* nsCOMPtr shell; aPresContext->GetShell(getter_AddRefs(shell)); @@ -93,6 +94,37 @@ nsDeckFrame::AttributeChanged(nsIPresContext* aPresContext, nsIReflowCommand::StyleChanged); if (NS_SUCCEEDED(rv)) shell->AppendReflowCommand(reflowCmd); + */ + + Invalidate(aPresContext, nsRect(0,0,mRect.width,mRect.height), PR_FALSE); + + int index = 0; + + // get the index attribute + nsAutoString value; + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::index, value)) + { + PRInt32 error; + + // convert it to an integer + index = value.ToInteger(&error); + } + + nsIFrame* childFrame = mFrames.FirstChild(); + nscoord count = 0; + while (nsnull != childFrame) + { + // make collapsed children not show up + if (index != count) + CollapseChild(*aPresContext, childFrame, PR_TRUE); + else + CollapseChild(*aPresContext, childFrame, PR_FALSE); + + rv = childFrame->GetNextSibling(&childFrame); + NS_ASSERTION(rv == NS_OK,"failed to get next child"); + count++; + } + } @@ -202,7 +234,6 @@ nsDeckFrame::SetInitialChildList(nsIPresContext& aPresContext, nsIFrame* aChildList) { nsresult r = nsBoxFrame::SetInitialChildList(aPresContext, aListName, aChildList); - return r; } @@ -235,6 +266,36 @@ nsDeckFrame::AddChildSize(nsBoxInfo& aInfo, nsBoxInfo& aChildInfo) nsresult nsDeckFrame::PlaceChildren(nsIPresContext& aPresContext, nsRect& boxRect) +{ + // ------- set the childs positions --------- + nsIFrame* childFrame = mFrames.FirstChild(); + nscoord count = 0; + while (nsnull != childFrame) + { + nsresult rv; + // make collapsed children not show up + if (mSprings[count].collapsed) { + //nsRect rect(0,0,0,0); + //childFrame->GetRect(rect); + //if (rect.width > 0 || rect.height > 0) { + // childFrame->SizeTo(0,0); + CollapseChild(aPresContext, childFrame, PR_TRUE); + //} + } else { + childFrame->MoveTo(&aPresContext, boxRect.x, boxRect.y); + } + + rv = childFrame->GetNextSibling(&childFrame); + NS_ASSERTION(rv == NS_OK,"failed to get next child"); + count++; + } + + return NS_OK; +} + +NS_IMETHODIMP +nsDeckFrame::DidReflow(nsIPresContext& aPresContext, + nsDidReflowStatus aStatus) { int index = 0; @@ -248,53 +309,28 @@ nsDeckFrame::PlaceChildren(nsIPresContext& aPresContext, nsRect& boxRect) index = value.ToInteger(&error); } - // ------- set the childs positions --------- + nsresult rv = nsBoxFrame::DidReflow(aPresContext, aStatus); + NS_ASSERTION(rv == NS_OK,"DidReflow failed"); + nsIFrame* childFrame = mFrames.FirstChild(); nscoord count = 0; while (nsnull != childFrame) { - nsresult rv; - - /* - // see if the child has a view. If it doesn't make one for it. - nsIView* childView = nsnull; - childFrame->GetView(&childView); - if (childView == nsnull) { - nsCOMPtr context; - childFrame->GetStyleContext(getter_AddRefs(context)); - CreateViewForFrame(aPresContext,childFrame,context,PR_TRUE); - childFrame->GetView(&childView); - NS_ASSERTION(childView != nsnull, "Deck could not create a view for its child!!!"); - } - */ - - //nsCOMPtr vm; - // childView->GetViewManager(*getter_AddRefs(vm)); - // make collapsed children not show up - if (mSprings[count].collapsed || count != index) { - CollapseChild(&aPresContext, childFrame); - // } if (count != index) { - // if the child is not in view then make sure its view is 0 so it clips - // out all its children. - //vm->ResizeView(childView, 0,0); - //childFrame->SizeTo(0,0); - //childView->SetParent(nsnull); - } else { - ////nsIView* pv; - //GetView(&pv); - //childView->SetParent(pv); - childFrame->MoveTo(&aPresContext, boxRect.x, boxRect.y); - } + if (index != count) + CollapseChild(aPresContext, childFrame, PR_TRUE); + else + CollapseChild(aPresContext, childFrame, PR_FALSE); rv = childFrame->GetNextSibling(&childFrame); NS_ASSERTION(rv == NS_OK,"failed to get next child"); count++; } - return NS_OK; + return rv; } + void nsDeckFrame::ChildResized(nsIFrame* aFrame, nsHTMLReflowMetrics& aDesiredSize, nsRect& aRect, nsCalculatedBoxInfo& aInfo, PRBool* aResized, nscoord& aChangedIndex, PRBool& aFinished, nscoord aIndex, nsString& aReason) { diff --git a/layout/xul/base/src/nsDeckFrame.h b/layout/xul/base/src/nsDeckFrame.h index 903c8f104af9..b400d62591fb 100644 --- a/layout/xul/base/src/nsDeckFrame.h +++ b/layout/xul/base/src/nsDeckFrame.h @@ -51,6 +51,9 @@ public: nsIAtom* aAttribute, PRInt32 aHint); + NS_IMETHOD DidReflow(nsIPresContext& aPresContext, + nsDidReflowStatus aStatus); + NS_IMETHOD Paint(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect, diff --git a/layout/xul/base/src/nsIBox.h b/layout/xul/base/src/nsIBox.h index 2753f5d04642..81640f039dd6 100644 --- a/layout/xul/base/src/nsIBox.h +++ b/layout/xul/base/src/nsIBox.h @@ -70,7 +70,7 @@ public: static const nsIID& GetIID() { static nsIID iid = NS_IBOX_IID; return iid; } NS_IMETHOD GetBoxInfo(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsBoxInfo& aSize)=0; - NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)=0; + NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)=0; }; #endif diff --git a/layout/xul/base/src/nsMenuFrame.cpp b/layout/xul/base/src/nsMenuFrame.cpp index a4d7b1f159f9..1e642b58d9e5 100644 --- a/layout/xul/base/src/nsMenuFrame.cpp +++ b/layout/xul/base/src/nsMenuFrame.cpp @@ -656,7 +656,7 @@ nsMenuFrame::DidReflow(nsIPresContext& aPresContext, // Overridden Box method. NS_IMETHODIMP -nsMenuFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild) +nsMenuFrame::Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild) { incrementalChild = nsnull; nsresult rv = NS_OK; @@ -670,7 +670,7 @@ nsMenuFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incremental } // Now call our original box frame method - rv = nsBoxFrame::Dirty(aReflowState, incrementalChild); + rv = nsBoxFrame::Dirty(aPresContext, aReflowState, incrementalChild); if (rv != NS_OK || incrementalChild) return rv; @@ -680,7 +680,7 @@ nsMenuFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incremental // to call its Dirty method... nsIBox* ibox; if (NS_SUCCEEDED(popup->QueryInterface(nsIBox::GetIID(), (void**)&ibox)) && ibox) - ibox->Dirty(aReflowState, incrementalChild); + ibox->Dirty(aPresContext, aReflowState, incrementalChild); else incrementalChild = frame; } diff --git a/layout/xul/base/src/nsMenuFrame.h b/layout/xul/base/src/nsMenuFrame.h index a7702a32f3b9..399c3a24f33c 100644 --- a/layout/xul/base/src/nsMenuFrame.h +++ b/layout/xul/base/src/nsMenuFrame.h @@ -97,7 +97,7 @@ public: NS_IMETHOD DidReflow(nsIPresContext& aPresContext, nsDidReflowStatus aStatus); - NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild); + NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild); NS_IMETHOD AppendFrames(nsIPresContext& aPresContext, nsIPresShell& aPresShell, diff --git a/layout/xul/base/src/nsPopupSetFrame.cpp b/layout/xul/base/src/nsPopupSetFrame.cpp index 6c936888bfe3..b6c6dac47f09 100644 --- a/layout/xul/base/src/nsPopupSetFrame.cpp +++ b/layout/xul/base/src/nsPopupSetFrame.cpp @@ -253,7 +253,7 @@ nsPopupSetFrame::DidReflow(nsIPresContext& aPresContext, // Overridden Box method. NS_IMETHODIMP -nsPopupSetFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild) +nsPopupSetFrame::Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild) { incrementalChild = nsnull; nsresult rv = NS_OK; @@ -267,7 +267,7 @@ nsPopupSetFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& increme } // Now call our original box frame method - rv = nsBoxFrame::Dirty(aReflowState, incrementalChild); + rv = nsBoxFrame::Dirty(aPresContext, aReflowState, incrementalChild); if (rv != NS_OK || incrementalChild) return rv; @@ -284,7 +284,7 @@ nsPopupSetFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& increme nsIFrame* ignore; nsIBox* ibox; if (NS_SUCCEEDED(popup->QueryInterface(nsIBox::GetIID(), (void**)&ibox)) && ibox) - ibox->Dirty(aReflowState, ignore); + ibox->Dirty(aPresContext, aReflowState, ignore); } return rv; diff --git a/layout/xul/base/src/nsPopupSetFrame.h b/layout/xul/base/src/nsPopupSetFrame.h index 54ac71f070d4..84c6d5b8f8ef 100644 --- a/layout/xul/base/src/nsPopupSetFrame.h +++ b/layout/xul/base/src/nsPopupSetFrame.h @@ -71,7 +71,7 @@ public: NS_IMETHOD DidReflow(nsIPresContext& aPresContext, nsDidReflowStatus aStatus); - NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild); + NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild); NS_IMETHOD AppendFrames(nsIPresContext& aPresContext, nsIPresShell& aPresShell, diff --git a/layout/xul/base/src/nsTabFrame.cpp b/layout/xul/base/src/nsTabFrame.cpp index 257ebef6320a..1c2ca994d74a 100644 --- a/layout/xul/base/src/nsTabFrame.cpp +++ b/layout/xul/base/src/nsTabFrame.cpp @@ -58,12 +58,6 @@ NS_NewTabFrame ( nsIFrame** aNewFrame ) } // NS_NewTabFrame -/* -nsTabFrame::nsTabFrame() -{ -} -*/ - void nsTabFrame::MouseClicked(nsIPresContext* aPresContext) { @@ -83,28 +77,37 @@ nsTabFrame::MouseClicked(nsIPresContext* aPresContext) return; } - /* - // set visiblity - PRInt32 count = 0; - tabpanel->ChildCount(count); - for (PRInt32 i = 0; i < count; i++) - { - nsIContent* child; - tabpanel->ChildAt(i,child); + // unselect the old tab - if (i != index) - child->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::style, "visibility: hidden", PR_TRUE); - else - child->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::style, "visibility: visible", PR_TRUE); - } - */ + // get the current index + nsAutoString v; + PRInt32 error; + tabpanel->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::index, v); + PRInt32 oldIndex = v.ToInteger(&error); + if (oldIndex != index) + { + // get the tab box + nsIContent* parent; + mContent->GetParent(parent); + + // get child + nsIContent* child; + parent->ChildAt(oldIndex, child); + + // set the old tab to be unselected + child->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::selected, "false", PR_TRUE); + + // set the new tab to be selected + mContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::selected, "true", PR_TRUE); + } // set the panels index char value[100]; sprintf(value, "%d", index); tabpanel->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::index, value, PR_TRUE); + } nsresult diff --git a/layout/xul/base/src/nsTabFrame.h b/layout/xul/base/src/nsTabFrame.h index 7ba494b41167..12330c853ab7 100644 --- a/layout/xul/base/src/nsTabFrame.h +++ b/layout/xul/base/src/nsTabFrame.h @@ -45,6 +45,26 @@ protected: virtual nsresult GetChildWithTag(nsIAtom* atom, nsIContent* start, nsIContent*& tabpanel); virtual nsresult GetTabControl(nsIContent* content, nsIContent*& tabcontrol); virtual nsresult GetIndexInParent(nsIContent* content, PRInt32& index); + // Selection Methods + // XXX Doc me... (in nsIFrame.h puhleeze) + // XXX If these are selection specific, then the name should imply selection + // rather than generic event processing, e.g., SelectionHandlePress... + NS_IMETHOD HandlePress(nsIPresContext& aPresContext, + nsGUIEvent * aEvent, + nsEventStatus& aEventStatus) { return NS_OK; } + + NS_IMETHOD HandleMultiplePress(nsIPresContext& aPresContext, + nsGUIEvent * aEvent, + nsEventStatus& aEventStatus) { return NS_OK; } + + + NS_IMETHOD HandleDrag(nsIPresContext& aPresContext, + nsGUIEvent * aEvent, + nsEventStatus& aEventStatus) { return NS_OK; } + + NS_IMETHOD HandleRelease(nsIPresContext& aPresContext, + nsGUIEvent * aEvent, + nsEventStatus& aEventStatus) { return NS_OK; } private: diff --git a/layout/xul/base/src/nsTitledButtonFrame.cpp b/layout/xul/base/src/nsTitledButtonFrame.cpp index f69d37a1e1f3..fc2588ab7c0e 100644 --- a/layout/xul/base/src/nsTitledButtonFrame.cpp +++ b/layout/xul/base/src/nsTitledButtonFrame.cpp @@ -1471,7 +1471,7 @@ nsTitledButtonFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr) } NS_IMETHODIMP -nsTitledButtonFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild) +nsTitledButtonFrame::Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild) { // leafs should just return themselves as the incremental child incrementalChild = this; diff --git a/layout/xul/base/src/nsTitledButtonFrame.h b/layout/xul/base/src/nsTitledButtonFrame.h index 66d936a3ae5e..4a74a4b3103f 100644 --- a/layout/xul/base/src/nsTitledButtonFrame.h +++ b/layout/xul/base/src/nsTitledButtonFrame.h @@ -36,7 +36,7 @@ public: // nsIBox frame interface NS_IMETHOD GetBoxInfo(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsBoxInfo& aSize); - NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild); + NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild); NS_DECL_ISUPPORTS diff --git a/mailnews/addrbook/resources/content/abCardOverlay.xul b/mailnews/addrbook/resources/content/abCardOverlay.xul index af3ce543d80a..1dca35500baf 100644 --- a/mailnews/addrbook/resources/content/abCardOverlay.xul +++ b/mailnews/addrbook/resources/content/abCardOverlay.xul @@ -33,9 +33,10 @@ Rights Reserved. - &Name.tab; + &Name.tab; &Address.tab; &Other.tab; + diff --git a/profile/resources/content/createProfileWizard.xul b/profile/resources/content/createProfileWizard.xul index 3a96cd93b8ec..18c5f444ea87 100644 --- a/profile/resources/content/createProfileWizard.xul +++ b/profile/resources/content/createProfileWizard.xul @@ -19,8 +19,9 @@ - &newprofile.title; - + &newprofile.title; + + diff --git a/xpfe/browser/samples/tab.xul b/xpfe/browser/samples/tab.xul index 55c1ada78083..3e9b7ffe37cc 100644 --- a/xpfe/browser/samples/tab.xul +++ b/xpfe/browser/samples/tab.xul @@ -6,16 +6,17 @@ xmlns:html="http://www.w3.org/TR/REC-html40" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - + - centered + centered percent html native iframe dialog + diff --git a/xpfe/components/search/resources/search.xul b/xpfe/components/search/resources/search.xul index 30e84aceb333..9f6d51ae13ca 100644 --- a/xpfe/components/search/resources/search.xul +++ b/xpfe/components/search/resources/search.xul @@ -49,10 +49,11 @@ - &find.title.label; + &find.title.label; &internet.title.label; &mailnews.title.label; &addressbook.title.label; + diff --git a/xpfe/global/resources/skin/global.css b/xpfe/global/resources/skin/global.css index f4b0938fe31f..a0204935a776 100644 --- a/xpfe/global/resources/skin/global.css +++ b/xpfe/global/resources/skin/global.css @@ -1089,6 +1089,13 @@ tabcontrol { border: none; } +/* when a tab is selected this is how it should look. + */ +tab[selected="true"] { + font-weight: bold; +} + + /********* XP Scrollbar *********/ thumb {