1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 16:45:08 +00:00

VisualBuilder: Allow resizing widgets using their grabbers.

This commit is contained in:
Andreas Kling 2019-04-11 02:35:30 +02:00
parent 3c8e53ef2b
commit d73f79a2d2
4 changed files with 94 additions and 2 deletions

View file

@ -42,6 +42,16 @@ Rect VBWidget::grabber_rect(Direction direction) const
}
}
Direction VBWidget::grabber_at(const Point& position) const
{
Direction found_grabber = Direction::None;
for_each_direction([&] (Direction direction) {
if (grabber_rect(direction).contains(position))
found_grabber = direction;
});
return found_grabber;
}
void VBWidget::paint(GPainter& painter)
{
painter.fill_rect(m_rect, Color::White);