UI: add optional tip callback to uiBut, and use it for per-item tooltips in UIList.

When defined, uiBut->tip_func is called when button's tip is generated. This allows
for advanced, dynamic generation of tooltips.

For now, only used by UIList, which can now optionaly use a given string property
of each item for its tooltip.

Thanks to Campbell for the reviews!
This commit is contained in:
2015-02-11 00:06:03 +01:00
parent d18993d4e4
commit 4f1e387588
8 changed files with 62 additions and 10 deletions

View File

@@ -254,7 +254,11 @@ struct uiBut {
uiLink *link;
short linkto[2]; /* region relative coords */
const char *tip, *lockstr;
const char *tip;
uiButToolTipFunc tip_func;
void *tip_argN;
const char *lockstr;
BIFIconID icon;
bool lock;