mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
ui fixes
This commit is contained in:
parent
0e0034ce56
commit
5a0a1cf326
4 changed files with 62 additions and 17 deletions
|
|
@ -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, {});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue