From 93d7c8c4f47834b10e2d21a85669178018737fc8 Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Sat, 18 Nov 2023 00:00:49 +0100 Subject: [PATCH] show base item in tooltip for badged toggle with badge off --- src/ui/defaulttrackerwindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ui/defaulttrackerwindow.cpp b/src/ui/defaulttrackerwindow.cpp index b2a13c9b..0aef9298 100644 --- a/src/ui/defaulttrackerwindow.cpp +++ b/src/ui/defaulttrackerwindow.cpp @@ -169,10 +169,14 @@ void DefaultTrackerWindow::setTracker(Tracker* tracker, const std::string& layou if (itemid.empty()) _lblTooltip->setText(""); else { auto& item = tracker->getItemById(itemid); - _lblTooltip->setText(item.getCurrentName()); + const auto& text = (item.getBaseItem().empty() || item.getState()) ? + item.getCurrentName() : tracker->getItemByCode(item.getBaseItem()).getCurrentName(); + _lblTooltip->setText(text); item.onChange += {this, [this, tracker, itemid](void* sender) { const auto& item = tracker->getItemById(itemid); - _lblTooltip->setText(item.getCurrentName()); + const auto& text = (item.getBaseItem().empty() || item.getState()) ? + item.getCurrentName() : tracker->getItemByCode(item.getBaseItem()).getCurrentName(); + _lblTooltip->setText(text); }}; } _lastHoverItem = itemid;