fix: tooltip visibility when cursor is hidden
This commit is contained in:
@@ -13,7 +13,7 @@ Container::Container(glm::vec2 size) : UINode(size) {
|
||||
}
|
||||
|
||||
std::shared_ptr<UINode> Container::getAt(glm::vec2 pos, std::shared_ptr<UINode> self) {
|
||||
if (!interactive || !isEnabled()) {
|
||||
if (!isInteractive() || !isEnabled()) {
|
||||
return nullptr;
|
||||
}
|
||||
if (!isInside(pos)) return nullptr;
|
||||
|
||||
@@ -13,6 +13,9 @@ UINode::~UINode() {
|
||||
}
|
||||
|
||||
bool UINode::isVisible() const {
|
||||
if (visible && parent) {
|
||||
return parent->isVisible();
|
||||
}
|
||||
return visible;
|
||||
}
|
||||
|
||||
@@ -107,7 +110,7 @@ bool UINode::isInside(glm::vec2 point) {
|
||||
}
|
||||
|
||||
std::shared_ptr<UINode> UINode::getAt(glm::vec2 point, std::shared_ptr<UINode> self) {
|
||||
if (!interactive || !enabled) {
|
||||
if (!isInteractive() || !enabled) {
|
||||
return nullptr;
|
||||
}
|
||||
return isInside(point) ? self : nullptr;
|
||||
@@ -145,7 +148,6 @@ float UINode::getTooltipDelay() const {
|
||||
return tooltipDelay;
|
||||
}
|
||||
|
||||
|
||||
glm::vec2 UINode::calcPos() const {
|
||||
if (parent) {
|
||||
return pos + parent->calcPos() + parent->contentOffset();
|
||||
@@ -332,6 +334,16 @@ void UINode::setGravity(Gravity gravity) {
|
||||
}
|
||||
}
|
||||
|
||||
bool UINode::isSubnodeOf(const UINode* node) {
|
||||
if (parent == nullptr) {
|
||||
return false;
|
||||
}
|
||||
if (parent == node) {
|
||||
return true;
|
||||
}
|
||||
return parent->isSubnodeOf(node);
|
||||
}
|
||||
|
||||
void UINode::getIndices(
|
||||
const std::shared_ptr<UINode> node,
|
||||
std::unordered_map<std::string, std::shared_ptr<UINode>>& map
|
||||
|
||||
@@ -245,6 +245,8 @@ namespace gui {
|
||||
|
||||
virtual void setGravity(Gravity gravity);
|
||||
|
||||
bool isSubnodeOf(const UINode* node);
|
||||
|
||||
/// @brief collect all nodes having id
|
||||
static void getIndices(
|
||||
const std::shared_ptr<UINode> node,
|
||||
|
||||
Reference in New Issue
Block a user