Updated to new GetDesiredSize api's (so that percentage width's could be properly calculated)

This commit is contained in:
kipp
1998-05-30 21:21:11 +00:00
parent 201c9ffdf3
commit 2c0de3a6c0
15 changed files with 77 additions and 47 deletions

View File

@@ -127,6 +127,7 @@ protected:
virtual ~nsInputButtonFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsSize& aMaxSize,
nsReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize);
@@ -418,7 +419,8 @@ nsInputButtonFrame::Reflow(nsIPresContext* aPresContext,
if ((kButtonTag_Input == GetButtonTagType()) &&
(kButton_Image == GetButtonType())) {
nsSize ignore;
GetDesiredSize(aPresContext, aReflowState.maxSize, aDesiredSize, ignore);
GetDesiredSize(aPresContext, aReflowState, aReflowState.maxSize,
aDesiredSize, ignore);
AddBordersAndPadding(aPresContext, aDesiredSize);
if (nsnull != aDesiredSize.maxElementSize) {
aDesiredSize.maxElementSize->width = aDesiredSize.width;
@@ -435,6 +437,7 @@ nsInputButtonFrame::Reflow(nsIPresContext* aPresContext,
void
nsInputButtonFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsSize& aMaxSize,
nsReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize)
@@ -453,12 +456,12 @@ nsInputButtonFrame::GetDesiredSize(nsIPresContext* aPresContext,
if (eContentAttr_HasValue == mContent->GetAttribute("SRC", src)) {
mImageLoader.SetURL(src);
}
mImageLoader.GetDesiredSize(aPresContext, this,
aDesiredLayoutSize, aMaxSize);
mImageLoader.GetDesiredSize(aPresContext, aReflowState, aMaxSize,
aDesiredLayoutSize);
}
else { // there is a widget
nsSize styleSize;
GetStyleSize(*aPresContext, styleSize);
GetStyleSize(*aPresContext, aReflowState, styleSize);
// a browse button shares is style context with its parent nsInputFile
// it uses everything from it except width
if (kButton_Browse == GetButtonType()) {