This commit is contained in:
Astazium 2026-09-30 20:43:43 +03:00
parent 0e0034ce56
commit 5a0a1cf326
4 changed files with 62 additions and 17 deletions

View file

@ -35,8 +35,15 @@ void InlineFrame::setDocument(const std::shared_ptr<UiDocument>& document) {
root->setSize(size);
gui.postRunnable([this]() {
scripting::on_ui_open(*this->document, {});
gui.postRunnable([weak = weak_from_this(), document]() {
auto node = weak.lock();
if (node == nullptr) {
return;
}
if (static_cast<InlineFrame&>(*node).document != document) {
return;
}
scripting::on_ui_open(*document, {});
});
}

View file

@ -82,6 +82,19 @@ void SplitBox::doubleClick(int x, int y) {
refresh();
}
std::shared_ptr<UINode> SplitBox::getAt(const glm::vec2& pos) {
auto hover = Container::getAt(pos);
if (hover.get() != this) {
return hover;
}
for (const auto& node : nodes) {
if (node->isVisible() && node->isInside(pos)) {
return nullptr;
}
}
return hover;
}
void SplitBox::fullRefresh() {
refresh();
reposition();

View file

@ -11,6 +11,7 @@ namespace gui {
virtual void refresh() override;
virtual void fullRefresh() override;
virtual void doubleClick(int x, int y) override;
virtual std::shared_ptr<UINode> getAt(const glm::vec2& pos) override;
private:
float splitPos;
};