зеркало из https://github.com/mozilla/gecko-dev.git
Fun with tree widget scrollbars.
This commit is contained in:
Родитель
2d90d87296
Коммит
5d793c4ca4
|
@ -33,6 +33,7 @@
|
||||||
#include "nsHTMLParts.h"
|
#include "nsHTMLParts.h"
|
||||||
#include "nsScrollbarButtonFrame.h"
|
#include "nsScrollbarButtonFrame.h"
|
||||||
#include "nsSliderFrame.h"
|
#include "nsSliderFrame.h"
|
||||||
|
#include "nsIDOMElement.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
// NS_NewTreeFrame
|
// NS_NewTreeFrame
|
||||||
|
@ -91,7 +92,16 @@ nsTreeRowGroupFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsTreeRowGroupFrame::PositionChanged(PRInt32 aOldIndex, PRInt32 aNewIndex)
|
nsTreeRowGroupFrame::PositionChanged(PRInt32 aOldIndex, PRInt32 aNewIndex)
|
||||||
{
|
{
|
||||||
|
if (aOldIndex == aNewIndex)
|
||||||
|
return NS_OK;
|
||||||
|
|
||||||
printf("The position changed!\n");
|
printf("The position changed!\n");
|
||||||
|
|
||||||
|
if (aNewIndex > aOldIndex) {
|
||||||
|
// Figure out how many rows we have to lose off the top.
|
||||||
|
PRInt32 rowsToLose = aNewIndex - aOldIndex;
|
||||||
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,6 +121,12 @@ nsTreeRowGroupFrame::SetScrollbarFrame(nsIFrame* aFrame)
|
||||||
nsIFrame* sliderFrame;
|
nsIFrame* sliderFrame;
|
||||||
nsScrollbarButtonFrame::GetChildWithTag(scrollbarAtom, aFrame, sliderFrame);
|
nsScrollbarButtonFrame::GetChildWithTag(scrollbarAtom, aFrame, sliderFrame);
|
||||||
((nsSliderFrame*)sliderFrame)->SetScrollbarListener(this);
|
((nsSliderFrame*)sliderFrame)->SetScrollbarListener(this);
|
||||||
|
|
||||||
|
nsCOMPtr<nsIContent> scrollbarContent;
|
||||||
|
sliderFrame->GetContent(getter_AddRefs(scrollbarContent));
|
||||||
|
nsCOMPtr<nsIDOMElement> scrollbarNode = do_QueryInterface(scrollbarContent);
|
||||||
|
scrollbarNode->SetAttribute("increment", "1");
|
||||||
|
scrollbarNode->SetAttribute("decrement", "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
PRBool nsTreeRowGroupFrame::RowGroupDesiresExcessSpace()
|
PRBool nsTreeRowGroupFrame::RowGroupDesiresExcessSpace()
|
||||||
|
@ -284,7 +300,7 @@ nsIFrame*
|
||||||
nsTreeRowGroupFrame::GetFirstFrameForReflow(nsIPresContext& aPresContext)
|
nsTreeRowGroupFrame::GetFirstFrameForReflow(nsIPresContext& aPresContext)
|
||||||
{
|
{
|
||||||
// Clear ourselves out.
|
// Clear ourselves out.
|
||||||
mTopFrame = mBottomFrame = nsnull;
|
mBottomFrame = mTopFrame = nsnull;
|
||||||
mIsFull = PR_FALSE;
|
mIsFull = PR_FALSE;
|
||||||
|
|
||||||
// We may just be a normal row group.
|
// We may just be a normal row group.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче