зеркало из https://github.com/mozilla/pjs.git
Fix forms: XP_MAC code was missing in GetHorizontalInsidePadding and GetVerticalInsidePadding
This commit is contained in:
Родитель
392e110ad0
Коммит
04ba615cb8
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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&
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче