the dark border is now drawn without holes at the edges, as on R5, also fixed the BBox being used as separator, like NetPositive does
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17112 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+58
-32
@@ -498,19 +498,26 @@ BBox::_DrawPlain(BRect labelBox)
|
||||
BRect rect = Bounds();
|
||||
rect.top += TopBorderOffset();
|
||||
|
||||
rgb_color light = tint_color(ViewColor(), B_LIGHTEN_MAX_TINT);
|
||||
rgb_color shadow = tint_color(ViewColor(), B_DARKEN_3_TINT);
|
||||
|
||||
BeginLineArray(4);
|
||||
AddLine(BPoint(rect.left, rect.bottom),
|
||||
BPoint(rect.left, rect.top), light);
|
||||
AddLine(BPoint(rect.left + 1.0f, rect.top),
|
||||
BPoint(rect.right, rect.top), light);
|
||||
AddLine(BPoint(rect.left + 1.0f, rect.bottom),
|
||||
BPoint(rect.right, rect.bottom), shadow);
|
||||
AddLine(BPoint(rect.right, rect.bottom - 1.0f),
|
||||
BPoint(rect.right, rect.top + 1.0f), shadow);
|
||||
EndLineArray();
|
||||
if (rect.Height() == 0.0 || rect.Width() == 0.0) {
|
||||
// used as separator
|
||||
SetHighColor(shadow);
|
||||
StrokeLine(rect.LeftTop(),rect.RightBottom());
|
||||
} else {
|
||||
// used as box
|
||||
rgb_color light = tint_color(ViewColor(), B_LIGHTEN_MAX_TINT);
|
||||
BeginLineArray(4);
|
||||
AddLine(BPoint(rect.left, rect.bottom),
|
||||
BPoint(rect.left, rect.top), light);
|
||||
AddLine(BPoint(rect.left + 1.0f, rect.top),
|
||||
BPoint(rect.right, rect.top), light);
|
||||
AddLine(BPoint(rect.left + 1.0f, rect.bottom),
|
||||
BPoint(rect.right, rect.bottom), shadow);
|
||||
AddLine(BPoint(rect.right, rect.bottom - 1.0f),
|
||||
BPoint(rect.right, rect.top + 1.0f), shadow);
|
||||
EndLineArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -523,27 +530,46 @@ BBox::_DrawFancy(BRect labelBox)
|
||||
rgb_color light = tint_color(ViewColor(), B_LIGHTEN_MAX_TINT);
|
||||
rgb_color shadow = tint_color(ViewColor(), B_DARKEN_3_TINT);
|
||||
|
||||
BeginLineArray(8);
|
||||
AddLine(BPoint(rect.left, rect.bottom),
|
||||
BPoint(rect.left, rect.top), shadow);
|
||||
AddLine(BPoint(rect.left + 1.0f, rect.top),
|
||||
BPoint(rect.right, rect.top), shadow);
|
||||
AddLine(BPoint(rect.left + 1.0f, rect.bottom),
|
||||
BPoint(rect.right, rect.bottom), light);
|
||||
AddLine(BPoint(rect.right, rect.bottom - 1.0f),
|
||||
BPoint(rect.right, rect.top + 1.0f), light);
|
||||
|
||||
rect.InsetBy(1.0, 1.0);
|
||||
|
||||
AddLine(BPoint(rect.left, rect.bottom),
|
||||
BPoint(rect.left, rect.top), light);
|
||||
AddLine(BPoint(rect.left + 1.0f, rect.top),
|
||||
BPoint(rect.right, rect.top), light);
|
||||
AddLine(BPoint(rect.left + 1.0f, rect.bottom),
|
||||
BPoint(rect.right, rect.bottom), shadow);
|
||||
AddLine(BPoint(rect.right, rect.bottom - 1.0f),
|
||||
BPoint(rect.right, rect.top + 1.0f), shadow);
|
||||
EndLineArray();
|
||||
if (rect.Height() == 1.0) {
|
||||
// used as horizontal separator
|
||||
BeginLineArray(2);
|
||||
AddLine(BPoint(rect.left, rect.top),
|
||||
BPoint(rect.right, rect.top), shadow);
|
||||
AddLine(BPoint(rect.left, rect.bottom),
|
||||
BPoint(rect.right, rect.bottom), light);
|
||||
EndLineArray();
|
||||
} else if (rect.Width() == 1.0) {
|
||||
// used as vertical separator
|
||||
BeginLineArray(2);
|
||||
AddLine(BPoint(rect.left, rect.top),
|
||||
BPoint(rect.left, rect.bottom), shadow);
|
||||
AddLine(BPoint(rect.right, rect.top),
|
||||
BPoint(rect.right, rect.bottom), light);
|
||||
EndLineArray();
|
||||
} else {
|
||||
// used as box
|
||||
BeginLineArray(8);
|
||||
AddLine(BPoint(rect.left, rect.bottom - 1.0),
|
||||
BPoint(rect.left, rect.top), shadow);
|
||||
AddLine(BPoint(rect.left + 1.0, rect.top),
|
||||
BPoint(rect.right - 1.0, rect.top), shadow);
|
||||
AddLine(BPoint(rect.left, rect.bottom),
|
||||
BPoint(rect.right, rect.bottom), light);
|
||||
AddLine(BPoint(rect.right, rect.bottom - 1.0),
|
||||
BPoint(rect.right, rect.top), light);
|
||||
|
||||
rect.InsetBy(1.0, 1.0);
|
||||
|
||||
AddLine(BPoint(rect.left, rect.bottom - 1.0),
|
||||
BPoint(rect.left, rect.top), light);
|
||||
AddLine(BPoint(rect.left + 1.0, rect.top),
|
||||
BPoint(rect.right - 1.0, rect.top), light);
|
||||
AddLine(BPoint(rect.left, rect.bottom),
|
||||
BPoint(rect.right, rect.bottom), shadow);
|
||||
AddLine(BPoint(rect.right, rect.bottom - 1.0),
|
||||
BPoint(rect.right, rect.top), shadow);
|
||||
EndLineArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user