Add SetVisibility method to Scroll Views

It now checks the visibility and adjusts the scrollbars accordingly
Bug 92333 r=kmcclusk sr=attinasi a=asa


git-svn-id: svn://10.0.0.236/trunk@117562 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rods%netscape.com
2002-03-27 02:58:56 +00:00
parent f6de1dd3b4
commit 56914b135e
2 changed files with 26 additions and 6 deletions

View File

@@ -1045,6 +1045,9 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext,
}
}
const nsStyleVisibility* vis;
GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&)vis);
#ifdef IBMBIDI
// Retrieve the scrollbar's width and height
float sbWidth = 0.0;
@@ -1055,9 +1058,6 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext,
// Convert to nscoord's by rounding
nscoord scrollbarWidth = NSToCoordRound(sbWidth);
const nsStyleVisibility* vis;
GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&)vis);
if (vis->mDirection == NS_STYLE_DIRECTION_RTL) {
nscoord bidiScrolledAreaWidth = scrolledAreaDesiredSize.maxElementSize->width;
firstPassState.reason = eReflowReason_StyleChange;
@@ -1103,6 +1103,16 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext,
aDesiredSize.maxElementSize->height = aDesiredSize.height;
}
// Set the visibility of the scrollbars
// although this may "turn on" both scrollbars everythime
// they do get adjusted back and show correctly
nsIScrollableView* scrollableView;
GetScrollableView(scrollableView);
if (scrollableView) {
PRBool isVis = vis->IsVisible();
scrollableView->SetScrollbarVisibility(isVis, isVis);
}
aStatus = NS_FRAME_COMPLETE;
#ifdef DEBUG_rodsX