1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:58:13 +00:00

HackStudio: Start fleshing out the GUI for a GUI designer :^)

I'll be reconstructing parts of the VisualBuilder application here and
then we can retire VisualBuilder entirely once all the functionality
is available in HackStudio.
This commit is contained in:
Andreas Kling 2019-11-08 20:55:58 +01:00
parent bce510bf6f
commit d016d5e365
9 changed files with 136 additions and 9 deletions

View file

@ -0,0 +1,27 @@
#include "FormWidget.h"
#include "FormEditorWidget.h"
#include <LibGUI/GPainter.h>
FormWidget::FormWidget(FormEditorWidget& parent)
: GWidget(&parent)
{
set_fill_with_background_color(true);
set_background_color(Color::WarmGray);
set_relative_rect(20, 20, 400, 300);
}
FormWidget::~FormWidget()
{
}
void FormWidget::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::from_rgb(0x404040));
}
}
}