Page MenuHome

UI: Support tooltips for superimposed icons
ClosedPublic

Authored by Julian Eisel (Severin) on Jul 13 2021, 12:25 PM.

Details

Summary

In a couple of places in the UI, we show superimposed icons on buttons to execute an operation (called "Extra Icons" internally). Hovering them would show the tooltip of the underlying button, which is misleading and confusing.
There are cases where it's not obvious what an icon does, so a tooltip would be quite useful here. It's likely we are going to use superimposed icons in more places in the future, e.g. see D11890.

Screenshots (mouse cursor is not visible, but it's hovering the icons):

The extra icon basically acts as an override for the button in the tooltip code.

This patch comes from rB2250b5cefee7 with an improvement to also get the operator description for the tooltip. rather than the button's regular description.

Diff Detail

Repository
rB Blender
Branch
temp-extra-icons-tooltips (branched from master)
Build Status
Buildable 15785
Build 15785: arc lint + arc unit

Event Timeline

Julian Eisel (Severin) requested review of this revision.Jul 13 2021, 12:25 PM
Julian Eisel (Severin) created this revision.
Julian Eisel (Severin) edited the summary of this revision. (Show Details)Jul 13 2021, 12:38 PM
  • Speparate string info function for extra icons (based on feedback by Campbell)
Julian Eisel (Severin) edited the summary of this revision. (Show Details)Jul 15 2021, 3:25 PM

Noted minor issues, otherwise LGTM.

source/blender/editors/interface/interface.c
7220

This misses Python tool-tips which only show with regular buttons.

This revision is now accepted and ready to land.Jul 16 2021, 2:44 AM
  • Fix operator Python tooltip text not displayed
source/blender/editors/interface/interface.c
7220

This is not handled by ui_tooltip_data_from_button_or_extra_icon() but wasn't working correctly. Fixed in the latest update.

This revision was automatically updated to reflect the committed changes.