mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
LibGUI: Add a GPainter class that inherits from Painter.
This gets rid of the last little piece of LibGUI knowledge in Painter.
This commit is contained in:
parent
326c6fd607
commit
9fa21fa585
27 changed files with 75 additions and 78 deletions
|
@ -2,7 +2,7 @@
|
|||
#include <LibGUI/GBoxLayout.h>
|
||||
#include <LibGUI/GButton.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <SharedGraphics/Painter.h>
|
||||
#include <LibGUI/GPainter.h>
|
||||
|
||||
GToolBar::GToolBar(GWidget* parent)
|
||||
: GWidget(parent)
|
||||
|
@ -56,7 +56,7 @@ public:
|
|||
|
||||
virtual void paint_event(GPaintEvent& event) override
|
||||
{
|
||||
Painter painter(*this);
|
||||
GPainter painter(*this);
|
||||
painter.set_clip_rect(event.rect());
|
||||
painter.translate(rect().center().x() - 1, 0);
|
||||
painter.draw_line({ 0, 0 }, { 0, rect().bottom() }, Color::MidGray);
|
||||
|
@ -77,7 +77,7 @@ void GToolBar::add_separator()
|
|||
|
||||
void GToolBar::paint_event(GPaintEvent& event)
|
||||
{
|
||||
Painter painter(*this);
|
||||
GPainter painter(*this);
|
||||
painter.set_clip_rect(event.rect());
|
||||
GStyle::the().paint_surface(painter, rect());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue