1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 00:37:35 +00:00

LibGUI: Share code for widget rendering styles in a GStyle class.

Since GScrollBar wants its internal buttons to look like GButtons,
let's share the painting code between them.
This commit is contained in:
Andreas Kling 2019-02-10 07:11:01 +01:00
parent 9ea2131adf
commit e354c08c98
9 changed files with 88 additions and 40 deletions

View file

@ -50,6 +50,7 @@ public:
Rect clip_rect() const { return m_clip_rect; }
void translate(int dx, int dy) { m_translation.move_by(dx, dy); }
void translate(const Point& delta) { m_translation.move_by(delta); }
private:
void set_pixel_with_draw_op(dword& pixel, const Color&);

View file

@ -28,7 +28,7 @@ public:
move_by(delta.x(), delta.y());
}
Point translated(int dx, int dy)
Point translated(int dx, int dy) const
{
Point point = *this;
point.move_by(dx, dy);

View file

@ -68,21 +68,21 @@ public:
set_height(height() - h);
}
Rect shrunken(int w, int h)
Rect shrunken(int w, int h) const
{
Rect rect = *this;
rect.shrink(w, h);
return rect;
}
Rect inflated(int w, int h)
Rect inflated(int w, int h) const
{
Rect rect = *this;
rect.inflate(w, h);
return rect;
}
Rect translated(int dx, int dy)
Rect translated(int dx, int dy) const
{
Rect rect = *this;
rect.move_by(dx, dy);