зеркало из https://github.com/mozilla/gecko-dev.git
Changing selection in the tree.
This commit is contained in:
Родитель
8ef606dbd7
Коммит
d6fb7c48ab
|
@ -247,7 +247,6 @@ nsTreeCellFrame::HandleDoubleClickEvent(nsIPresContext& aPresContext,
|
|||
pShell->ExitReflowLock();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -256,17 +255,24 @@ nsTreeCellFrame::HandleDoubleClickEvent(nsIPresContext& aPresContext,
|
|||
void
|
||||
nsTreeCellFrame::Select(nsIPresContext& aPresContext, PRBool isSelected, PRBool notifyForReflow)
|
||||
{
|
||||
nsCOMPtr<nsIAtom> kSelectedAtom ( dont_AddRef(NS_NewAtom("selected")) );
|
||||
nsCOMPtr<nsIAtom> kSelectedCellAtom(dont_AddRef(NS_NewAtom("selectedcell")));
|
||||
nsCOMPtr<nsIAtom> kSelectedAtom(dont_AddRef(NS_NewAtom("selected")));
|
||||
|
||||
nsIContent* pParentContent;
|
||||
mContent->GetParent(pParentContent);
|
||||
|
||||
if (isSelected)
|
||||
{
|
||||
// We're selecting the node.
|
||||
mContent->SetAttribute(nsXULAtoms::nameSpaceID, kSelectedAtom, "true", notifyForReflow);
|
||||
|
||||
mContent->SetAttribute(nsXULAtoms::nameSpaceID, kSelectedCellAtom, "true", notifyForReflow);
|
||||
pParentContent->SetAttribute(nsXULAtoms::nameSpaceID, kSelectedAtom, "true", notifyForReflow);
|
||||
}
|
||||
else
|
||||
{
|
||||
// We're unselecting the node.
|
||||
mContent->UnsetAttribute(nsXULAtoms::nameSpaceID, kSelectedAtom, notifyForReflow);
|
||||
// We're deselecting the node.
|
||||
mContent->UnsetAttribute(nsXULAtoms::nameSpaceID, kSelectedCellAtom, notifyForReflow);
|
||||
pParentContent->UnsetAttribute(nsXULAtoms::nameSpaceID, kSelectedAtom, notifyForReflow);
|
||||
}
|
||||
|
||||
NS_IF_RELEASE(pParentContent);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче