UI: allow off/on icons to be in reverse order.

The same icons are reused for "hide" and "show" properties, which need
to be in reverse order compared to each other.
This commit is contained in:
2018-10-29 16:58:34 +01:00
parent 4c7f08e5eb
commit b5667c2ca7
6 changed files with 30 additions and 6 deletions

View File

@@ -2985,7 +2985,11 @@ void ui_but_update_ex(uiBut *but, const bool validate)
case UI_BTYPE_ICON_TOGGLE:
case UI_BTYPE_ICON_TOGGLE_N:
if (!but->rnaprop || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) {
if ((but->rnaprop == NULL) || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) {
if (but->rnaprop && RNA_property_flag(but->rnaprop) & PROP_ICONS_REVERSE) {
but->drawflag |= UI_BUT_ICON_REVERSE;
}
but->iconadd = (but->flag & UI_SELECT) ? 1 : 0;
}
break;