예제 #1
0
void
WinDecorator::_DrawClose(BRect r)
{
	// Just like DrawZoom, but for a close button
	DrawBeveledRect(r,GetClose());
	
	// Draw the X

	BRect rect(r);
	rect.InsetBy(4,4);
	rect.right--;
	rect.top--;
	
	if (GetClose())
		rect.OffsetBy(1,1);

	fDrawingEngine->SetHighColor(RGBColor(0,0,0));
	fDrawingEngine->StrokeLine(rect.LeftTop(),rect.RightBottom());
	fDrawingEngine->StrokeLine(rect.RightTop(),rect.LeftBottom());
	rect.OffsetBy(1,0);
	fDrawingEngine->StrokeLine(rect.LeftTop(),rect.RightBottom());
	fDrawingEngine->StrokeLine(rect.RightTop(),rect.LeftBottom());
}
예제 #2
0
void
MacDecorator::_DrawClose(BRect r)
{
    bool down = GetClose();

    // Just like DrawZoom, but for a close button
    BRect rect(r);

    BPoint offset(r.LeftTop()), pt2(r.RightTop());

    // Topleft dark grey border
    pt2.x--;
    fDrawingEngine->SetHighColor(RGBColor(136, 136, 136));
    fDrawingEngine->StrokeLine(offset, pt2);

    pt2 = r.LeftBottom();
    pt2.y--;
    fDrawingEngine->StrokeLine(offset, pt2);

    // Bottomright white border
    offset = r.RightBottom();
    pt2 = r.RightTop();
    pt2.y++;
    fDrawingEngine->SetHighColor(RGBColor(255, 255, 255));
    fDrawingEngine->StrokeLine(offset, pt2);

    pt2 = r.LeftBottom();
    pt2.x++;
    fDrawingEngine->StrokeLine(offset, pt2);

    // Black outline
    rect.InsetBy(1, 1);
    fDrawingEngine->SetHighColor(RGBColor(0, 0, 0));
    fDrawingEngine->StrokeRect(rect);

    // Double-shaded button
    rect.InsetBy(1, 1);
    _DrawBlendedRect(fDrawingEngine, rect, down);
    rect.InsetBy(1, 1);
    _DrawBlendedRect(fDrawingEngine, rect, !down);
}