зеркало из https://github.com/mozilla/pjs.git
Still screwing around with menus.
This commit is contained in:
Родитель
11b6c79de6
Коммит
869159019e
|
@ -16,7 +16,7 @@
|
|||
* Reserved.
|
||||
*/
|
||||
|
||||
|
||||
#include "nsXULAtoms.h"
|
||||
#include "nsMenuFrame.h"
|
||||
#include "nsAreaFrame.h"
|
||||
#include "nsIContent.h"
|
||||
|
@ -81,6 +81,26 @@ nsMenuFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
if (nsLayoutAtoms::popupList == aListName) {
|
||||
mPopupFrames.SetFrames(aChildList);
|
||||
} else {
|
||||
|
||||
nsFrameList frames(aChildList);
|
||||
|
||||
// We may have an xpmenuchildren in here. Get it out, and move it into
|
||||
// the popup frame list.
|
||||
nsIFrame* frame = frames.FirstChild();
|
||||
while (frame) {
|
||||
nsCOMPtr<nsIContent> content;
|
||||
frame->GetContent(getter_AddRefs(content));
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
content->GetTag(*getter_AddRefs(tag));
|
||||
if (tag.get() == nsXULAtoms::xpmenuchildren) {
|
||||
// Remove this frame from the list and place it in the other list.
|
||||
frames.RemoveFrame(frame);
|
||||
mPopupFrames.AppendFrame(this, frame);
|
||||
rv = nsAreaFrame::SetInitialChildList(aPresContext, aListName, aChildList);
|
||||
return rv;
|
||||
}
|
||||
frame->GetNextSibling(&frame);
|
||||
}
|
||||
rv = nsAreaFrame::SetInitialChildList(aPresContext, aListName, aChildList);
|
||||
}
|
||||
return rv;
|
||||
|
@ -120,4 +140,4 @@ nsMenuFrame::GetFrameForPoint(const nsPoint& aPoint,
|
|||
{
|
||||
*aFrame = this; // Capture all events so that we can perform selection
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ nsMenuPopupFrame::Init(nsIPresContext& aPresContext,
|
|||
aContext,
|
||||
PR_FALSE,
|
||||
getter_AddRefs(menuStyle));
|
||||
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, menuStyle, aPrevInFlow);
|
||||
rv = nsBoxFrame::Init(aPresContext, aContent, aParent, menuStyle, aPrevInFlow);
|
||||
CreateViewForFrame(aPresContext, this, menuStyle, PR_TRUE);
|
||||
return rv;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче