зеркало из https://github.com/mozilla/pjs.git
focus rects should now be hidden
r=pollmann sr=buster
This commit is contained in:
Родитель
5015efb725
Коммит
1f6b99d689
|
@ -2502,33 +2502,37 @@ nsComboboxControlFrame::Paint(nsIPresContext* aPresContext,
|
||||||
/////////////////////
|
/////////////////////
|
||||||
// draw focus
|
// draw focus
|
||||||
// XXX This is only temporary
|
// XXX This is only temporary
|
||||||
nsCOMPtr<nsIEventStateManager> stateManager;
|
const nsStyleDisplay* disp = (const nsStyleDisplay*)mStyleContext->GetStyleData(eStyleStruct_Display);
|
||||||
nsresult rv = mPresContext->GetEventStateManager(getter_AddRefs(stateManager));
|
// Only paint the focus if we're visible
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (disp->IsVisible()) {
|
||||||
if (NS_SUCCEEDED(rv) && !nsFormFrame::GetDisabled(this) && mFocused == this) {
|
nsCOMPtr<nsIEventStateManager> stateManager;
|
||||||
aRenderingContext.SetLineStyle(nsLineStyle_kDotted);
|
nsresult rv = mPresContext->GetEventStateManager(getter_AddRefs(stateManager));
|
||||||
aRenderingContext.SetColor(0);
|
if (NS_SUCCEEDED(rv)) {
|
||||||
} else {
|
if (NS_SUCCEEDED(rv) && !nsFormFrame::GetDisabled(this) && mFocused == this) {
|
||||||
const nsStyleColor* myColor = (const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
|
aRenderingContext.SetLineStyle(nsLineStyle_kDotted);
|
||||||
aRenderingContext.SetColor(myColor->mBackgroundColor);
|
aRenderingContext.SetColor(0);
|
||||||
aRenderingContext.SetLineStyle(nsLineStyle_kSolid);
|
} else {
|
||||||
|
const nsStyleColor* myColor = (const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
|
||||||
|
aRenderingContext.SetColor(myColor->mBackgroundColor);
|
||||||
|
aRenderingContext.SetLineStyle(nsLineStyle_kSolid);
|
||||||
|
}
|
||||||
|
//aRenderingContext.DrawRect(clipRect);
|
||||||
|
float p2t;
|
||||||
|
aPresContext->GetPixelsToTwips(&p2t);
|
||||||
|
nscoord onePixel = NSIntPixelsToTwips(1, p2t);
|
||||||
|
clipRect.width -= onePixel;
|
||||||
|
clipRect.height -= onePixel;
|
||||||
|
aRenderingContext.DrawLine(clipRect.x, clipRect.y,
|
||||||
|
clipRect.x+clipRect.width, clipRect.y);
|
||||||
|
aRenderingContext.DrawLine(clipRect.x+clipRect.width, clipRect.y,
|
||||||
|
clipRect.x+clipRect.width, clipRect.y+clipRect.height);
|
||||||
|
aRenderingContext.DrawLine(clipRect.x+clipRect.width, clipRect.y+clipRect.height,
|
||||||
|
clipRect.x, clipRect.y+clipRect.height);
|
||||||
|
aRenderingContext.DrawLine(clipRect.x, clipRect.y+clipRect.height,
|
||||||
|
clipRect.x, clipRect.y);
|
||||||
|
aRenderingContext.DrawLine(clipRect.x, clipRect.y+clipRect.height,
|
||||||
|
clipRect.x, clipRect.y);
|
||||||
}
|
}
|
||||||
//aRenderingContext.DrawRect(clipRect);
|
|
||||||
float p2t;
|
|
||||||
aPresContext->GetPixelsToTwips(&p2t);
|
|
||||||
nscoord onePixel = NSIntPixelsToTwips(1, p2t);
|
|
||||||
clipRect.width -= onePixel;
|
|
||||||
clipRect.height -= onePixel;
|
|
||||||
aRenderingContext.DrawLine(clipRect.x, clipRect.y,
|
|
||||||
clipRect.x+clipRect.width, clipRect.y);
|
|
||||||
aRenderingContext.DrawLine(clipRect.x+clipRect.width, clipRect.y,
|
|
||||||
clipRect.x+clipRect.width, clipRect.y+clipRect.height);
|
|
||||||
aRenderingContext.DrawLine(clipRect.x+clipRect.width, clipRect.y+clipRect.height,
|
|
||||||
clipRect.x, clipRect.y+clipRect.height);
|
|
||||||
aRenderingContext.DrawLine(clipRect.x, clipRect.y+clipRect.height,
|
|
||||||
clipRect.x, clipRect.y);
|
|
||||||
aRenderingContext.DrawLine(clipRect.x, clipRect.y+clipRect.height,
|
|
||||||
clipRect.x, clipRect.y);
|
|
||||||
}
|
}
|
||||||
/////////////////////
|
/////////////////////
|
||||||
aRenderingContext.PopState(clipEmpty);
|
aRenderingContext.PopState(clipEmpty);
|
||||||
|
|
|
@ -2502,33 +2502,37 @@ nsComboboxControlFrame::Paint(nsIPresContext* aPresContext,
|
||||||
/////////////////////
|
/////////////////////
|
||||||
// draw focus
|
// draw focus
|
||||||
// XXX This is only temporary
|
// XXX This is only temporary
|
||||||
nsCOMPtr<nsIEventStateManager> stateManager;
|
const nsStyleDisplay* disp = (const nsStyleDisplay*)mStyleContext->GetStyleData(eStyleStruct_Display);
|
||||||
nsresult rv = mPresContext->GetEventStateManager(getter_AddRefs(stateManager));
|
// Only paint the focus if we're visible
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (disp->IsVisible()) {
|
||||||
if (NS_SUCCEEDED(rv) && !nsFormFrame::GetDisabled(this) && mFocused == this) {
|
nsCOMPtr<nsIEventStateManager> stateManager;
|
||||||
aRenderingContext.SetLineStyle(nsLineStyle_kDotted);
|
nsresult rv = mPresContext->GetEventStateManager(getter_AddRefs(stateManager));
|
||||||
aRenderingContext.SetColor(0);
|
if (NS_SUCCEEDED(rv)) {
|
||||||
} else {
|
if (NS_SUCCEEDED(rv) && !nsFormFrame::GetDisabled(this) && mFocused == this) {
|
||||||
const nsStyleColor* myColor = (const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
|
aRenderingContext.SetLineStyle(nsLineStyle_kDotted);
|
||||||
aRenderingContext.SetColor(myColor->mBackgroundColor);
|
aRenderingContext.SetColor(0);
|
||||||
aRenderingContext.SetLineStyle(nsLineStyle_kSolid);
|
} else {
|
||||||
|
const nsStyleColor* myColor = (const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
|
||||||
|
aRenderingContext.SetColor(myColor->mBackgroundColor);
|
||||||
|
aRenderingContext.SetLineStyle(nsLineStyle_kSolid);
|
||||||
|
}
|
||||||
|
//aRenderingContext.DrawRect(clipRect);
|
||||||
|
float p2t;
|
||||||
|
aPresContext->GetPixelsToTwips(&p2t);
|
||||||
|
nscoord onePixel = NSIntPixelsToTwips(1, p2t);
|
||||||
|
clipRect.width -= onePixel;
|
||||||
|
clipRect.height -= onePixel;
|
||||||
|
aRenderingContext.DrawLine(clipRect.x, clipRect.y,
|
||||||
|
clipRect.x+clipRect.width, clipRect.y);
|
||||||
|
aRenderingContext.DrawLine(clipRect.x+clipRect.width, clipRect.y,
|
||||||
|
clipRect.x+clipRect.width, clipRect.y+clipRect.height);
|
||||||
|
aRenderingContext.DrawLine(clipRect.x+clipRect.width, clipRect.y+clipRect.height,
|
||||||
|
clipRect.x, clipRect.y+clipRect.height);
|
||||||
|
aRenderingContext.DrawLine(clipRect.x, clipRect.y+clipRect.height,
|
||||||
|
clipRect.x, clipRect.y);
|
||||||
|
aRenderingContext.DrawLine(clipRect.x, clipRect.y+clipRect.height,
|
||||||
|
clipRect.x, clipRect.y);
|
||||||
}
|
}
|
||||||
//aRenderingContext.DrawRect(clipRect);
|
|
||||||
float p2t;
|
|
||||||
aPresContext->GetPixelsToTwips(&p2t);
|
|
||||||
nscoord onePixel = NSIntPixelsToTwips(1, p2t);
|
|
||||||
clipRect.width -= onePixel;
|
|
||||||
clipRect.height -= onePixel;
|
|
||||||
aRenderingContext.DrawLine(clipRect.x, clipRect.y,
|
|
||||||
clipRect.x+clipRect.width, clipRect.y);
|
|
||||||
aRenderingContext.DrawLine(clipRect.x+clipRect.width, clipRect.y,
|
|
||||||
clipRect.x+clipRect.width, clipRect.y+clipRect.height);
|
|
||||||
aRenderingContext.DrawLine(clipRect.x+clipRect.width, clipRect.y+clipRect.height,
|
|
||||||
clipRect.x, clipRect.y+clipRect.height);
|
|
||||||
aRenderingContext.DrawLine(clipRect.x, clipRect.y+clipRect.height,
|
|
||||||
clipRect.x, clipRect.y);
|
|
||||||
aRenderingContext.DrawLine(clipRect.x, clipRect.y+clipRect.height,
|
|
||||||
clipRect.x, clipRect.y);
|
|
||||||
}
|
}
|
||||||
/////////////////////
|
/////////////////////
|
||||||
aRenderingContext.PopState(clipEmpty);
|
aRenderingContext.PopState(clipEmpty);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче