Skip to content

Commit

Permalink
fix: empty tooltip does not trigger reset
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailRis committed Jun 5, 2024
1 parent 04c27ca commit d316a5f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/graphics/ui/GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ void GUI::updateTooltip(float delta) {
if (tooltipTimer + delta >= hover->getTooltipDelay()) {
auto label = std::dynamic_pointer_cast<gui::Label>(get("tooltip.label"));
const auto& text = hover->getTooltip();
if (text.empty() && tooltip->isVisible()) {
return resetTooltip();
}
if (label && !text.empty()) {
tooltip->setVisible(true);
label->setText(langs::get(text));
Expand Down

0 comments on commit d316a5f

Please sign in to comment.