1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:27:34 +00:00

Intense hacking on Widgets.

This commit is contained in:
Andreas Kling 2018-10-10 16:49:36 +02:00
parent 8c84f9749e
commit 6f37429f57
20 changed files with 290 additions and 5 deletions

26
Widgets/Label.cpp Normal file
View file

@ -0,0 +1,26 @@
#include "Label.h"
#include "Painter.h"
#include <cstdio>
Label::Label(Widget* parent)
: Widget(parent)
{
setRect(Rect(100, 100, 100, 100));
}
Label::~Label()
{
}
void Label::onPaint(PaintEvent&)
{
Painter painter(*this);
painter.fillRect({ 0, 0, width(), height() }, Color(0xc0, 0xc0, 0xc0));
}
void Label::onMouseMove(MouseEvent& event)
{
printf("Label::onMouseMove: x=%d, y=%d\n", event.x(), event.y());
Widget::onMouseMove(event);
}