1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

VisualBuilder: Start working on an interface builder application.

It's tedious making interfaces programmatically. Let's make a program to
help us with this. :^)
This commit is contained in:
Andreas Kling 2019-04-11 00:05:47 +02:00
parent 0bc72551f4
commit 8268ece1bd
10 changed files with 156 additions and 0 deletions

View file

@ -0,0 +1,25 @@
#include "VBForm.h"
#include <LibGUI/GPainter.h>
VBForm::VBForm(const String& name, GWidget* parent)
: GWidget(parent)
{
set_fill_with_background_color(true);
set_background_color(Color::LightGray);
}
VBForm::~VBForm()
{
}
void VBForm::paint_event(GPaintEvent& event)
{
GPainter painter(*this);
painter.add_clip_rect(event.rect());
for (int y = 0; y < height(); y += m_grid_size) {
for (int x = 0; x < width(); x += m_grid_size) {
painter.set_pixel({ x, y }, Color::Black);
}
}
}