[Bf-blender-cvs] [3bc808ebcbf] master: UI: Tweak decimate modifier layout
Hans Goudey
noreply at git.blender.org
Fri Oct 16 23:04:21 CEST 2020
Commit: 3bc808ebcbf64d35c9b42e9f6e0c1d03d0d6cc31
Author: Hans Goudey
Date: Fri Oct 16 16:02:37 2020 -0500
Branches: master
https://developer.blender.org/rB3bc808ebcbf64d35c9b42e9f6e0c1d03d0d6cc31
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} |
===================================================================
M source/blender/modifiers/intern/MOD_decimate.c
===================================================================
diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c
index bf7b6493a36..2532afc933e 100644
--- a/source/blender/modifiers/intern/MOD_decimate.c
+++ b/source/blender/modifiers/intern/MOD_decimate.c
@@ -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);
More information about the Bf-blender-cvs
mailing list