mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
fix: empty tooltip does not trigger reset
This commit is contained in:
parent
04c27ca800
commit
d316a5f818
1 changed files with 3 additions and 0 deletions
|
|
@ -73,6 +73,9 @@ void GUI::updateTooltip(float delta) {
|
||||||
if (tooltipTimer + delta >= hover->getTooltipDelay()) {
|
if (tooltipTimer + delta >= hover->getTooltipDelay()) {
|
||||||
auto label = std::dynamic_pointer_cast<gui::Label>(get("tooltip.label"));
|
auto label = std::dynamic_pointer_cast<gui::Label>(get("tooltip.label"));
|
||||||
const auto& text = hover->getTooltip();
|
const auto& text = hover->getTooltip();
|
||||||
|
if (text.empty() && tooltip->isVisible()) {
|
||||||
|
return resetTooltip();
|
||||||
|
}
|
||||||
if (label && !text.empty()) {
|
if (label && !text.empty()) {
|
||||||
tooltip->setVisible(true);
|
tooltip->setVisible(true);
|
||||||
label->setText(langs::get(text));
|
label->setText(langs::get(text));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue