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:
parent
3c8e53ef2b
commit
d73f79a2d2
4 changed files with 94 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue