Fix forms: XP_MAC code was missing in GetHorizontalInsidePadding and GetVerticalInsidePadding

git-svn-id: svn://10.0.0.236/trunk@16732 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pierre%netscape.com 1998-12-20 13:18:10 +00:00
parent 16d2b789af
commit e7b77e958f
4 changed files with 72 additions and 0 deletions

View File

@ -101,6 +101,15 @@ nsTextControlFrame::GetVerticalInsidePadding(float aPixToTwip,
#ifdef XP_UNIX
return NSIntPixelsToTwips(10, aPixToTwip); // XXX this is probably wrong
#endif
#ifdef XP_MAC
PRInt32 type;
GetType(&type);
if (NS_FORM_TEXTAREA == type) {
return (nscoord)NSToIntRound(float(aInnerHeight) * 0.40f);
} else {
return (nscoord)NSToIntRound(float(aInnerHeight) * 0.25f);
}
#endif
}
nscoord
@ -128,6 +137,22 @@ nsTextControlFrame::GetHorizontalInsidePadding(nsIPresContext& aPresContext,
#ifdef XP_UNIX
return NSIntPixelsToTwips(6, aPixToTwip); // XXX this is probably wrong
#endif
#ifdef XP_MAC
nscoord padding;
PRInt32 type;
GetType(&type);
if (NS_FORM_TEXTAREA == type) {
padding = (nscoord)(40 * aCharWidth / 100);
} else {
padding = (nscoord)(95 * aCharWidth / 100);
}
nscoord min = NSIntPixelsToTwips(3, aPixToTwip);
if (padding > min) {
return padding;
} else {
return min;
}
#endif
}

View File

@ -151,6 +151,9 @@ nsButtonControlFrame::GetVerticalInsidePadding(float aPixToTwip,
#ifdef XP_UNIX
return (nscoord)NSToIntRound((float)aInnerHeight * 0.50f);
#endif
#ifdef XP_MAC
return (nscoord)NSToIntRound((float)aInnerHeight * 0.50f);
#endif
}
nscoord
@ -176,6 +179,13 @@ nsButtonControlFrame::GetHorizontalInsidePadding(nsIPresContext& aPresContext,
return NSIntPixelsToTwips(20, aPixToTwip);
}
#endif
#ifdef XP_MAC
if (eCompatibility_NavQuirks == mode) {
return (nscoord)NSToIntRound(float(aInnerWidth) * 0.5f);
} else {
return NSIntPixelsToTwips(20, aPixToTwip);
}
#endif
}

View File

@ -169,6 +169,9 @@ nsSelectControlFrame::GetVerticalInsidePadding(float aPixToTwip,
#ifdef XP_UNIX
return NSIntPixelsToTwips(1, aPixToTwip); // XXX this is probably wrong
#endif
#ifdef XP_MAC
return (nscoord)NSToIntRound(float(aInnerHeight) * 0.10f);
#endif
}
PRInt32
@ -189,6 +192,15 @@ nsSelectControlFrame::GetHorizontalInsidePadding(nsIPresContext& aPresContext,
#ifdef XP_UNIX
return NSIntPixelsToTwips(7, aPixToTwip); // XXX this is probably wrong
#endif
#ifdef XP_MAC
nscoord padding = (nscoord)NSToIntRound(float(aCharWidth) * 0.40f);
nscoord min = NSIntPixelsToTwips(3, aPixToTwip);
if (padding > min) {
return padding;
} else {
return min;
}
#endif
}
const nsIID&

View File

@ -101,6 +101,15 @@ nsTextControlFrame::GetVerticalInsidePadding(float aPixToTwip,
#ifdef XP_UNIX
return NSIntPixelsToTwips(10, aPixToTwip); // XXX this is probably wrong
#endif
#ifdef XP_MAC
PRInt32 type;
GetType(&type);
if (NS_FORM_TEXTAREA == type) {
return (nscoord)NSToIntRound(float(aInnerHeight) * 0.40f);
} else {
return (nscoord)NSToIntRound(float(aInnerHeight) * 0.25f);
}
#endif
}
nscoord
@ -128,6 +137,22 @@ nsTextControlFrame::GetHorizontalInsidePadding(nsIPresContext& aPresContext,
#ifdef XP_UNIX
return NSIntPixelsToTwips(6, aPixToTwip); // XXX this is probably wrong
#endif
#ifdef XP_MAC
nscoord padding;
PRInt32 type;
GetType(&type);
if (NS_FORM_TEXTAREA == type) {
padding = (nscoord)(40 * aCharWidth / 100);
} else {
padding = (nscoord)(95 * aCharWidth / 100);
}
nscoord min = NSIntPixelsToTwips(3, aPixToTwip);
if (padding > min) {
return padding;
} else {
return min;
}
#endif
}