diff options
author | Andreas Kling <kling@serenityos.org> | 2021-04-04 23:51:00 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-05 11:42:54 +0200 |
commit | 3bb36dbd3f97a94adaf442643983e6111c82ae4d (patch) | |
tree | a87c65307857f61578cd2c0537c8cda2aea98727 /Userland/Games/2048/BoardView.cpp | |
parent | 45d4bf156d9a91d0516a9cf8badf7b7cbd5fcc7b (diff) | |
download | serenity-3bb36dbd3f97a94adaf442643983e6111c82ae4d.zip |
2048: Give the board view a nice GUI::Frame look :^)
Diffstat (limited to 'Userland/Games/2048/BoardView.cpp')
-rw-r--r-- | Userland/Games/2048/BoardView.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Userland/Games/2048/BoardView.cpp b/Userland/Games/2048/BoardView.cpp index 5730c494d6..a2196605ce 100644 --- a/Userland/Games/2048/BoardView.cpp +++ b/Userland/Games/2048/BoardView.cpp @@ -177,11 +177,16 @@ Gfx::Color BoardView::text_color_for_cell(u32 value) return Color::from_rgb(0xf9f6f2); } -void BoardView::paint_event(GUI::PaintEvent&) +void BoardView::paint_event(GUI::PaintEvent& event) { + Frame::paint_event(event); + Color background_color = Color::from_rgb(0xbbada0); GUI::Painter painter(*this); + painter.add_clip_rect(event.rect()); + painter.add_clip_rect(frame_inner_rect()); + painter.translate(frame_thickness(), frame_thickness()); if (!m_board) { painter.fill_rect(rect(), background_color); |