зеркало из https://github.com/mozilla/gecko-dev.git
uses the new factored code for calculating size it helps for calculating suggested size
(see nsGfxButtonControlFrame.cpp)
This commit is contained in:
Родитель
596cd15f00
Коммит
3bca354587
|
@ -409,6 +409,15 @@ void ButtonHack(nsHTMLReflowState& aReflowState, char* aMessage)
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLButtonControlFrame::AddComputedBorderPaddingToDesiredSize(nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aSuggestedReflowState)
|
||||
{
|
||||
aDesiredSize.width += aSuggestedReflowState.mComputedBorderPadding.left + aSuggestedReflowState.mComputedBorderPadding.right;
|
||||
aDesiredSize.height += aSuggestedReflowState.mComputedBorderPadding.top + aSuggestedReflowState.mComputedBorderPadding.bottom;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
|
@ -514,8 +523,9 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext,
|
|||
else
|
||||
aDesiredSize.height += focusPadding.top + focusPadding.bottom;
|
||||
|
||||
aDesiredSize.width += aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right;
|
||||
aDesiredSize.height += aReflowState.mComputedBorderPadding.top + aReflowState.mComputedBorderPadding.bottom;
|
||||
AddComputedBorderPaddingToDesiredSize(aDesiredSize, aReflowState);
|
||||
//aDesiredSize.width += aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right;
|
||||
//aDesiredSize.height += aReflowState.mComputedBorderPadding.top + aReflowState.mComputedBorderPadding.bottom;
|
||||
|
||||
//adjust our max element size, if necessary
|
||||
if (aDesiredSize.maxElementSize) {
|
||||
|
|
|
@ -135,6 +135,8 @@ public:
|
|||
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
|
||||
|
||||
protected:
|
||||
NS_IMETHOD AddComputedBorderPaddingToDesiredSize(nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aSuggestedReflowState);
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
||||
NS_IMETHOD_(nsrefcnt) Release(void);
|
||||
void GetTranslatedRect(nsRect& aRect);
|
||||
|
|
|
@ -409,6 +409,15 @@ void ButtonHack(nsHTMLReflowState& aReflowState, char* aMessage)
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLButtonControlFrame::AddComputedBorderPaddingToDesiredSize(nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aSuggestedReflowState)
|
||||
{
|
||||
aDesiredSize.width += aSuggestedReflowState.mComputedBorderPadding.left + aSuggestedReflowState.mComputedBorderPadding.right;
|
||||
aDesiredSize.height += aSuggestedReflowState.mComputedBorderPadding.top + aSuggestedReflowState.mComputedBorderPadding.bottom;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
|
@ -514,8 +523,9 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext,
|
|||
else
|
||||
aDesiredSize.height += focusPadding.top + focusPadding.bottom;
|
||||
|
||||
aDesiredSize.width += aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right;
|
||||
aDesiredSize.height += aReflowState.mComputedBorderPadding.top + aReflowState.mComputedBorderPadding.bottom;
|
||||
AddComputedBorderPaddingToDesiredSize(aDesiredSize, aReflowState);
|
||||
//aDesiredSize.width += aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right;
|
||||
//aDesiredSize.height += aReflowState.mComputedBorderPadding.top + aReflowState.mComputedBorderPadding.bottom;
|
||||
|
||||
//adjust our max element size, if necessary
|
||||
if (aDesiredSize.maxElementSize) {
|
||||
|
|
|
@ -135,6 +135,8 @@ public:
|
|||
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
|
||||
|
||||
protected:
|
||||
NS_IMETHOD AddComputedBorderPaddingToDesiredSize(nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aSuggestedReflowState);
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
||||
NS_IMETHOD_(nsrefcnt) Release(void);
|
||||
void GetTranslatedRect(nsRect& aRect);
|
||||
|
|
Загрузка…
Ссылка в новой задаче