Set ascent/descent information so that vertical alignment works better
git-svn-id: svn://10.0.0.236/trunk@1065 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
4016c14fb8
commit
51777f1e3b
@ -99,6 +99,8 @@ void FormElementFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
float p2t = aPresContext->GetPixelsToTwips();
|
||||
aDesiredSize.width = nscoord(75 * p2t);
|
||||
aDesiredSize.height = nscoord(37 * p2t);
|
||||
aDesiredSize.ascent = aDesiredSize.height;
|
||||
aDesiredSize.descent = 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@ -401,6 +401,8 @@ nsInputButtonFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
if (kButton_Hidden == GetButtonType()) { // there is no physical rep
|
||||
aDesiredLayoutSize.width = 0;
|
||||
aDesiredLayoutSize.height = 0;
|
||||
aDesiredLayoutSize.ascent = 0;
|
||||
aDesiredLayoutSize.descent = 0;
|
||||
}
|
||||
else {
|
||||
nsSize styleSize;
|
||||
@ -444,6 +446,8 @@ nsInputButtonFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
aDesiredLayoutSize.width = size.width;
|
||||
aDesiredLayoutSize.height= size.height;
|
||||
}
|
||||
aDesiredLayoutSize.ascent = aDesiredLayoutSize.height;
|
||||
aDesiredLayoutSize.descent = 0;
|
||||
}
|
||||
|
||||
aDesiredWidgetSize.width = aDesiredLayoutSize.width;
|
||||
|
||||
@ -116,6 +116,8 @@ nsInputCheckboxFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
PRInt32 padding = GetPadding();
|
||||
aDesiredLayoutSize.width = aDesiredWidgetSize.width + (2 * padding);
|
||||
aDesiredLayoutSize.height = aDesiredWidgetSize.height;
|
||||
aDesiredLayoutSize.ascent = aDesiredLayoutSize.height;
|
||||
aDesiredLayoutSize.descent = 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@ -161,6 +161,8 @@ nsInputFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
// subclasses should always override this method, but if not and no css, make it small
|
||||
aDesiredLayoutSize.width = (styleSize.width > CSS_NOTSET) ? styleSize.width : 144;
|
||||
aDesiredLayoutSize.height = (styleSize.height > CSS_NOTSET) ? styleSize.height : 144;
|
||||
aDesiredLayoutSize.ascent = aDesiredLayoutSize.height;
|
||||
aDesiredLayoutSize.descent = 0;
|
||||
aDesiredWidgetSize.width = aDesiredLayoutSize.width;
|
||||
aDesiredWidgetSize.height = aDesiredLayoutSize.height;
|
||||
}
|
||||
|
||||
@ -110,6 +110,8 @@ nsInputRadioFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
PRInt32 padding = GetPadding();
|
||||
aDesiredLayoutSize.width = aDesiredWidgetSize.width + (2 * padding);
|
||||
aDesiredLayoutSize.height = aDesiredWidgetSize.height;
|
||||
aDesiredLayoutSize.ascent = aDesiredLayoutSize.height;
|
||||
aDesiredLayoutSize.descent = 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@ -141,6 +141,8 @@ nsInputTextFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
|
||||
aDesiredLayoutSize.width = size.width;
|
||||
aDesiredLayoutSize.height = size.height;
|
||||
aDesiredLayoutSize.ascent = aDesiredLayoutSize.height;
|
||||
aDesiredLayoutSize.descent = 0;
|
||||
aDesiredWidgetSize.width = aDesiredLayoutSize.width;
|
||||
aDesiredWidgetSize.height = aDesiredLayoutSize.height;
|
||||
}
|
||||
|
||||
@ -228,13 +228,14 @@ nsSelectFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
aDesiredLayoutSize.width = ((numRows < select->ChildCount()) || isCombo)
|
||||
? calcSize.width + 350 : calcSize.width + 100;
|
||||
aDesiredLayoutSize.height = calcSize.height;
|
||||
aDesiredLayoutSize.ascent = aDesiredLayoutSize.height;
|
||||
aDesiredLayoutSize.descent = 0;
|
||||
|
||||
aDesiredWidgetSize.width = aDesiredLayoutSize.width;
|
||||
aDesiredWidgetSize.height =
|
||||
(isCombo && !heightExplicit) ? aDesiredLayoutSize.height + (rowHeight * numChildren) + 100
|
||||
: aDesiredLayoutSize.height;
|
||||
|
||||
|
||||
NS_RELEASE(select);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user