TreeView and tooltip bug

Hi,

By default tooltip uses under mouse component, which for items in TreeView is currently TreeView::ItemComponent.
The issue here is that TreeView::ItemComponent do not use TreeViewItem getTooltip interface.

it’s implemented in the following function but not used as child are under the mouse and not ContentComponent

    String TreeView::ContentComponent::getTooltip() override
    {
        if (auto* itemComponent = getItemComponentAt (getMouseXYRelative()))
            return itemComponent->getRepresentedItem().getTooltip();

        return owner.getTooltip();
    }

Maybe there used to be no ItemComponent ?

fixing the issue is just adding

String getTooltip() override
 {
    return item.getTooltip();
  }

to TreeView::ItemComponent and inherit from public TooltipClient

Thanks !

bump

I’ve got a pending fix for this issue - it’ll be released after the next point release.

1 Like

This issue is now fixed on develop:

1 Like