UI: Click modifier icon to set active modifier

This should be a final piece of the changes for the active modifier
interface. Before, it was necessary to click on the blank space of a
modifier panel to set it active (not the header), this commit allows
clicking on the icon also.

The spacing with the spacing with the expand button would ideally
be a bit larger, but the layout system doesn't offer much flexibility
here.
This commit is contained in:
Hans Goudey 2020-12-13 23:49:14 -06:00
parent 260fca5d08
commit fddbcb5757
1 changed files with 7 additions and 1 deletions

View File

@ -307,10 +307,16 @@ static void modifier_panel_header(const bContext *C, Panel *panel)
/* Modifier Icon. */
sub = uiLayoutRow(layout, true);
uiLayoutSetEmboss(sub, UI_EMBOSS_NONE);
if (mti->isDisabled && mti->isDisabled(scene, md, 0)) {
uiLayoutSetRedAlert(sub, true);
}
uiItemL(sub, "", RNA_struct_ui_icon(ptr->type));
uiItemStringO(sub,
"",
RNA_struct_ui_icon(ptr->type),
"OBJECT_OT_modifier_set_active",
"modifier",
md->name);
row = uiLayoutRow(layout, true);