mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 14:07:42 +00:00
WindowServer: Use StylePainter to draw the window close buttons.
This commit is contained in:
parent
e2cd7529ab
commit
6edcf2f16e
1 changed files with 4 additions and 4 deletions
|
@ -14,6 +14,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <SharedGraphics/StylePainter.h>
|
||||||
#include <SharedGraphics/PNGLoader.h>
|
#include <SharedGraphics/PNGLoader.h>
|
||||||
|
|
||||||
#ifdef KERNEL
|
#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->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)
|
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();
|
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);
|
StylePainter::the().paint_button(*m_back_painter, close_button_rect, ButtonStyle::Normal, false, false);
|
||||||
|
|
||||||
m_back_painter->blit(titlebar_icon_rect.location(), window.icon(), window.icon().rect());
|
|
||||||
|
|
||||||
m_back_painter->draw_rect(close_button_rect, Color::MidGray);
|
|
||||||
auto x_location = close_button_rect.center();
|
auto x_location = close_button_rect.center();
|
||||||
x_location.move_by(-(s_close_button_bitmap_width / 2), -(s_close_button_bitmap_height / 2));
|
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);
|
m_back_painter->draw_bitmap(x_location, *s_close_button_bitmap, Color::Black);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue