diff options
Diffstat (limited to 'Widgets/WindowManager.cpp')
-rw-r--r-- | Widgets/WindowManager.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/Widgets/WindowManager.cpp b/Widgets/WindowManager.cpp index 15fab7a39b..467c764ce2 100644 --- a/Widgets/WindowManager.cpp +++ b/Widgets/WindowManager.cpp @@ -31,7 +31,7 @@ void WindowManager::paintWindowFrame(Widget& widget) printf("WM: paintWindowFrame %s{%p}, rect: %d,%d %dx%d\n", widget.className(), &widget, widget.rect().x(), widget.rect().y(), widget.rect().width(), widget.rect().height()); static const int windowFrameWidth = 2; - static const int windowTitleBarHeight = 14; + static const int windowTitleBarHeight = 16; Rect topRect { widget.x() - windowFrameWidth, @@ -59,12 +59,25 @@ void WindowManager::paintWindowFrame(Widget& widget) widget.height() }; - p.fillRect(topRect, Color(0x40, 0x40, 0xc0)); - p.fillRect(bottomRect, Color(0x40, 0x40, 0xc0)); - p.fillRect(leftRect, Color(0x40, 0x40, 0xc0)); - p.fillRect(rightRect, Color(0x40, 0x40, 0xc0)); + static const Color windowBorderColor(0x00, 0x00, 0x80); + static const Color windowTitleColor(0xff, 0xff, 0xff); - p.drawText(topRect, widget.windowTitle(), Painter::TextAlignment::Center, Color(255, 255, 255)); + Rect borderRect { + topRect.x() - 1, + topRect.y() - 1, + topRect.width() + 2, + windowFrameWidth + windowTitleBarHeight + widget.height() + 4 + }; + p.drawRect(borderRect, Color(255, 255, 255)); + borderRect.inflate(2, 2); + p.drawRect(borderRect, windowBorderColor); + + p.fillRect(topRect, windowBorderColor); + p.fillRect(bottomRect, windowBorderColor); + p.fillRect(leftRect, windowBorderColor); + p.fillRect(rightRect, windowBorderColor); + + p.drawText(topRect, widget.windowTitle(), Painter::TextAlignment::Center, windowTitleColor); } void WindowManager::addWindow(Widget& widget) |