UI: Tweak decimate modifier layout

- Expand the "Type" toggle at the top. This is consistent with other
  modifiers where there is a "Type" option at the top. It conveys the
  property's importance and makes it faster to switch it.
- Expand the "Delimit" option vertically so the text isn't squashed.
  There isn't enough space on one line for this, and is has to be
  expanded because more than one option can be selected. This is also
  consistent with how "multi-select" enums are often displayed, like
  the 3D view snapping settings.

|   Before   |   After    |
| {F9000996} | {F9000985} |
This commit is contained in:
Hans Goudey 2020-10-16 16:02:37 -05:00
parent c275a00a72
commit 3bc808ebcb
1 changed files with 5 additions and 4 deletions

View File

@ -235,13 +235,13 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
PointerRNA ob_ptr;
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr);
uiLayoutSetPropSep(layout, true);
int decimate_type = RNA_enum_get(ptr, "decimate_type");
char count_info[32];
snprintf(count_info, 32, "%s: %d", IFACE_("Face Count"), RNA_int_get(ptr, "face_count"));
uiItemR(layout, ptr, "decimate_type", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "decimate_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
uiLayoutSetPropSep(layout, true);
if (decimate_type == MOD_DECIM_MODE_COLLAPSE) {
uiItemR(layout, ptr, "ratio", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
@ -268,7 +268,8 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
}
else { /* decimate_type == MOD_DECIM_MODE_DISSOLVE. */
uiItemR(layout, ptr, "angle_limit", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "delimit", 0, NULL, ICON_NONE);
uiLayout *col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "delimit", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "use_dissolve_boundaries", 0, NULL, ICON_NONE);
}
uiItemL(layout, count_info, ICON_NONE);