From 6103c9d186cf534bc36e4bffcf402091358759b1 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 23 Sep 2017 09:10:28 +0200 Subject: [PATCH] Fix top border for modal windows. Patch by "Ben" in #9498. --- .../decorators/MacDecorator/MacDecorator.cpp | 58 ++++++++++++++++--- 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/src/add-ons/decorators/MacDecorator/MacDecorator.cpp b/src/add-ons/decorators/MacDecorator/MacDecorator.cpp index 9c2a7f4e51..3c4d5aeeb5 100644 --- a/src/add-ons/decorators/MacDecorator/MacDecorator.cpp +++ b/src/add-ons/decorators/MacDecorator/MacDecorator.cpp @@ -349,20 +349,60 @@ MacDecorator::_DrawFrame(BRect invalid) fDrawingEngine->StrokeLine(offset, pt2, fFrameLowerColor); // Draw the top side of the frame that is not in the tab - offset = r.RightTop(); - pt2 = r.RightBottom(); + if (fTopTab->look == B_MODAL_WINDOW_LOOK) { + offset = r.LeftTop(); + pt2 = r.RightTop(); + + fDrawingEngine->StrokeLine(offset, pt2, fFrameLowerColor); + offset.x++; + offset.y++; + pt2.x--; + pt2.y++; - fDrawingEngine->StrokeLine(topleftpt, toprightpt, fFrameLowerColor); - topleftpt.y--; - toprightpt.x++; - toprightpt.y--; - - fDrawingEngine->StrokeLine(topleftpt, toprightpt, fFrameLowColor); + fDrawingEngine->StrokeLine(offset, pt2, fFrameHighColor); + offset.x++; + offset.y++; + pt2.x--; + pt2.y++; + + fDrawingEngine->StrokeLine(offset, pt2, fFrameMidColor); + offset.x++; + offset.y++; + pt2.x--; + pt2.y++; + + fDrawingEngine->StrokeLine(offset, pt2, fFrameMidColor); + offset.x++; + offset.y++; + pt2.x--; + pt2.y++; + + fDrawingEngine->StrokeLine(offset, pt2, fFrameLowColor); + offset.x++; + offset.y++; + pt2.x--; + pt2.y++; + + fDrawingEngine->StrokeLine(offset, pt2, fFrameLowerColor); + } else { + // Some odd stuff here where the title bar is melded into the + // window border so that the sides are drawn into the title + // so we draw this bottom up + offset = topleftpt; + pt2 = toprightpt; + + fDrawingEngine->StrokeLine(offset, pt2, fFrameLowerColor); + offset.y--; + offset.x++; + pt2.y--; + + fDrawingEngine->StrokeLine(offset, pt2, fFrameLowColor); + } + // Draw the bottom side of the frame offset = r.LeftBottom(); pt2 = r.RightBottom(); - // Draw the bottom side of the frame fDrawingEngine->StrokeLine(offset, pt2, fFrameLowerColor); offset.x++; offset.y--;