summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-28 17:46:40 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-28 17:46:40 +0100
commit6edcf2f16ec0c03e517533a9ad8d9e0ebd5ea9d2 (patch)
tree1aa9c98027cf2202d2bbf713aaf2cbd4ea664789
parente2cd7529abdf54ed7cbd136c56714b3bd0b826c3 (diff)
downloadserenity-6edcf2f16ec0c03e517533a9ad8d9e0ebd5ea9d2.zip
WindowServer: Use StylePainter to draw the window close buttons.
-rw-r--r--Servers/WindowServer/WSWindowManager.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Servers/WindowServer/WSWindowManager.cpp b/Servers/WindowServer/WSWindowManager.cpp
index 0d97877830..7e14d5a59e 100644
--- a/Servers/WindowServer/WSWindowManager.cpp
+++ b/Servers/WindowServer/WSWindowManager.cpp
@@ -14,6 +14,7 @@
#include <unistd.h>
#include <stdio.h>
#include <time.h>
+#include <SharedGraphics/StylePainter.h>
#include <SharedGraphics/PNGLoader.h>
#ifdef KERNEL
@@ -500,14 +501,13 @@ void WSWindowManager::paint_window_frame(WSWindow& window)
m_back_painter->draw_text(titlebar_title_rect, window.title(), window_title_font(), TextAlignment::CenterLeft, title_color);
+ m_back_painter->blit(titlebar_icon_rect.location(), window.icon(), window.icon().rect());
+
if (!s_close_button_bitmap)
s_close_button_bitmap = &CharacterBitmap::create_from_ascii(s_close_button_bitmap_data, s_close_button_bitmap_width, s_close_button_bitmap_height).leak_ref();
- m_back_painter->fill_rect_with_gradient(close_button_rect.shrunken(2, 2), Color::LightGray, Color::White);
-
- m_back_painter->blit(titlebar_icon_rect.location(), window.icon(), window.icon().rect());
+ StylePainter::the().paint_button(*m_back_painter, close_button_rect, ButtonStyle::Normal, false, false);
- m_back_painter->draw_rect(close_button_rect, Color::MidGray);
auto x_location = close_button_rect.center();
x_location.move_by(-(s_close_button_bitmap_width / 2), -(s_close_button_bitmap_height / 2));
m_back_painter->draw_bitmap(x_location, *s_close_button_bitmap, Color::Black);