Skip to content

Commit

Permalink
show base item in tooltip for badged toggle with badge off
Browse files Browse the repository at this point in the history
  • Loading branch information
black-sliver committed Nov 22, 2023
1 parent 493151e commit 93d7c8c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ui/defaulttrackerwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 93d7c8c

Please sign in to comment.