Focus locking and popups

This commit is contained in:
IlyaShurupov 2024-10-17 15:10:58 +03:00 committed by Ilya Shurupov
parent 96b293d1b5
commit c7496c7b42
13 changed files with 296 additions and 145 deletions

View file

@ -97,12 +97,6 @@ WidgetManagerInterface* Widget::getRoot() {
return dynamic_cast<WidgetManagerInterface*>(iter);
}
void Widget::triggerWidgetUpdate(const char* reason) {
if (auto root = getRoot()) {
root->updateWidget(this, reason);
}
}
void Widget::setAreaCache(const tp::RectF& area) { mAreaCache = area; }
void Widget::setArea(const RectF& area) {
@ -128,3 +122,26 @@ void Widget::setDebug(const char* name, RGBA col) {
void Widget::setSizePolicy(SizePolicy x, SizePolicy y) {
getLayout()->setSizePolicy(x, y);
}
void Widget::triggerWidgetUpdate(const char* reason) {
if (auto root = getRoot()) {
root->updateWidget(this, reason);
}
}
void Widget::openPopup(Widget* widget) {
addChild(widget);
getRoot()->openPopup(widget);
}
void Widget::closePopup(Widget* widget) {
getRoot()->closePopup(widget);
}
void Widget::lockFocus() {
getRoot()->lockFocus(this);
}
void Widget::freeFocus() {
getRoot()->freeFocus(this);
}