diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-10-12 14:15:14 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-10-12 14:16:40 +0200 |
commit | 16576112b0004a912f73f216488ebfda50ed1efe (patch) | |
tree | 0a2da73508c4c137609abaeb8508fd54f8b71c0a /Widgets/Widget.cpp | |
parent | c7463aad1159488fc6b9f7134dd88d0bf0b87b27 (diff) | |
download | serenity-16576112b0004a912f73f216488ebfda50ed1efe.zip |
Add a CheckBox widget.
Diffstat (limited to 'Widgets/Widget.cpp')
-rw-r--r-- | Widgets/Widget.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Widgets/Widget.cpp b/Widgets/Widget.cpp index 8332abd92d..f5a66e79f1 100644 --- a/Widgets/Widget.cpp +++ b/Widgets/Widget.cpp @@ -16,10 +16,10 @@ Widget::~Widget() { } -void Widget::setRect(const Rect& rect) +void Widget::setWindowRelativeRect(const Rect& rect) { // FIXME: Make some kind of event loop driven ResizeEvent? - m_rect = rect; + m_relativeRect = rect; update(); } @@ -102,8 +102,8 @@ Widget::HitTestResult Widget::hitTest(int x, int y) // FIXME: Care about z-order. for (auto* ch : children()) { auto* child = (Widget*)ch; - if (child->rect().contains(x, y)) { - return child->hitTest(x - child->rect().x(), y - child->rect().y()); + if (child->relativeRect().contains(x, y)) { + return child->hitTest(x - child->relativeRect().x(), y - child->relativeRect().y()); } } return { this, x, y }; |