diff --git a/LibGUI/GCheckBox.cpp b/LibGUI/GCheckBox.cpp index 50f70182ec..62808b3704 100644 --- a/LibGUI/GCheckBox.cpp +++ b/LibGUI/GCheckBox.cpp @@ -1,6 +1,7 @@ -#include "GCheckBox.h" +#include #include #include +#include #include //#define GCHECKBOX_DEBUG @@ -20,8 +21,8 @@ static const char* s_checked_bitmap_data = { static CharacterBitmap* s_checked_bitmap; static const int s_checked_bitmap_width = 9; static const int s_checked_bitmap_height = 9; -static const int s_box_width = 11; -static const int s_box_height = 11; +static const int s_box_width = 13; +static const int s_box_height = 13; GCheckBox::GCheckBox(GWidget* parent) : GWidget(parent) @@ -65,27 +66,20 @@ void GCheckBox::paint_event(GPaintEvent& event) painter.fill_rect(rect(), background_color()); Rect box_rect { - 2, height() / 2 - s_box_height / 2 - 1, + 0, height() / 2 - s_box_height / 2 - 1, s_box_width, s_box_height }; painter.fill_rect(box_rect, Color::White); - painter.draw_rect(box_rect, Color::Black); + StylePainter::paint_frame(painter, box_rect, FrameShape::Container, FrameShadow::Sunken, 2); if (m_being_modified) - painter.draw_rect(box_rect.shrunken(2, 2), Color::MidGray); + painter.draw_rect(box_rect.shrunken(4, 4), Color::MidGray); if (m_checked) - painter.draw_bitmap(box_rect.shrunken(2, 2).location(), *s_checked_bitmap, foreground_color()); + painter.draw_bitmap(box_rect.shrunken(4, 4).location(), *s_checked_bitmap, foreground_color()); if (!caption().is_empty()) painter.draw_text(text_rect, caption(), TextAlignment::TopLeft, foreground_color()); - - if (is_focused()) { - // NOTE: Painter::draw_focus_rect() will shrink(2,2) the passed rect. - auto focus_rect = box_rect; - focus_rect.inflate(4, 4); - painter.draw_focus_rect(focus_rect); - } } void GCheckBox::mousemove_event(GMouseEvent& event)