UI: Use property split in geometry node properties

This makes the nodes look more consistent with the rest of the UI
by using the same split with right aligned labels as the property editor
and elsewhere. Additionally, for consistency, the "Type" part of some
dropdowns is removed. It already wasn't displayed everywhere, and
it gets redundant quite quickly.
This commit is contained in:
Hans Goudey 2021-02-19 14:39:08 -06:00
parent b8bf662cce
commit ee1c674775
11 changed files with 35 additions and 11 deletions

View File

@ -40,6 +40,8 @@ static void geo_node_align_rotation_to_vector_layout(uiLayout *layout,
PointerRNA *ptr)
{
uiItemR(layout, ptr, "axis", UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
uiLayoutSetPropSep(layout, true);
uiLayoutSetPropDecorate(layout, false);
uiItemR(layout, ptr, "pivot_axis", 0, IFACE_("Pivot"), ICON_NONE);
uiLayout *col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "input_type_factor", 0, IFACE_("Factor"), ICON_NONE);

View File

@ -40,9 +40,12 @@ static void geo_node_attribute_combine_xyz_layout(uiLayout *layout,
bContext *UNUSED(C),
PointerRNA *ptr)
{
uiItemR(layout, ptr, "input_type_x", 0, IFACE_("Type X"), ICON_NONE);
uiItemR(layout, ptr, "input_type_y", 0, IFACE_("Type Y"), ICON_NONE);
uiItemR(layout, ptr, "input_type_z", 0, IFACE_("Type Z"), ICON_NONE);
uiLayoutSetPropSep(layout, true);
uiLayoutSetPropDecorate(layout, false);
uiLayout *col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "input_type_x", 0, IFACE_("X"), ICON_NONE);
uiItemR(col, ptr, "input_type_y", 0, IFACE_("Y"), ICON_NONE);
uiItemR(col, ptr, "input_type_z", 0, IFACE_("Z"), ICON_NONE);
}
namespace blender::nodes {

View File

@ -56,8 +56,10 @@ static void geo_node_attribute_compare_layout(uiLayout *layout,
PointerRNA *ptr)
{
uiItemR(layout, ptr, "operation", 0, "", ICON_NONE);
uiItemR(layout, ptr, "input_type_a", 0, IFACE_("Type A"), ICON_NONE);
uiItemR(layout, ptr, "input_type_b", 0, IFACE_("Type B"), ICON_NONE);
uiLayoutSetPropSep(layout, true);
uiLayoutSetPropDecorate(layout, false);
uiItemR(layout, ptr, "input_type_a", 0, IFACE_("A"), ICON_NONE);
uiItemR(layout, ptr, "input_type_b", 0, IFACE_("B"), ICON_NONE);
}
static void geo_node_attribute_compare_init(bNodeTree *UNUSED(tree), bNode *node)

View File

@ -42,6 +42,8 @@ static bNodeSocketTemplate geo_node_attribute_fill_out[] = {
static void geo_node_attribute_fill_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayoutSetPropSep(layout, true);
uiLayoutSetPropDecorate(layout, false);
uiItemR(layout, ptr, "data_type", 0, "", ICON_NONE);
// uiItemR(layout, ptr, "domain", 0, "", ICON_NONE);
}

View File

@ -115,13 +115,15 @@ static void geo_node_attribute_math_layout(uiLayout *layout, bContext *UNUSED(C)
NodeMathOperation operation = (NodeMathOperation)node_storage->operation;
uiItemR(layout, ptr, "operation", 0, "", ICON_NONE);
uiItemR(layout, ptr, "input_type_a", 0, IFACE_("Type A"), ICON_NONE);
uiLayoutSetPropSep(layout, true);
uiLayoutSetPropDecorate(layout, false);
uiItemR(layout, ptr, "input_type_a", 0, IFACE_("A"), ICON_NONE);
if (operation_use_input_b(operation)) {
uiItemR(layout, ptr, "input_type_b", 0, IFACE_("Type B"), ICON_NONE);
uiItemR(layout, ptr, "input_type_b", 0, IFACE_("B"), ICON_NONE);
}
if (operation_use_input_c(operation)) {
uiItemR(layout, ptr, "input_type_c", 0, IFACE_("Type C"), ICON_NONE);
uiItemR(layout, ptr, "input_type_c", 0, IFACE_("C"), ICON_NONE);
}
}

View File

@ -46,6 +46,8 @@ static bNodeSocketTemplate geo_node_mix_attribute_out[] = {
static void geo_node_attribute_mix_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayoutSetPropSep(layout, true);
uiLayoutSetPropDecorate(layout, false);
uiItemR(layout, ptr, "blend_type", 0, "", ICON_NONE);
uiLayout *col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "input_type_factor", 0, IFACE_("Factor"), ICON_NONE);

View File

@ -40,6 +40,8 @@ static void geo_node_attribute_separate_xyz_layout(uiLayout *layout,
bContext *UNUSED(C),
PointerRNA *ptr)
{
uiLayoutSetPropSep(layout, true);
uiLayoutSetPropDecorate(layout, false);
uiItemR(layout, ptr, "input_type", 0, IFACE_("Type"), ICON_NONE);
}

View File

@ -77,13 +77,15 @@ static void geo_node_attribute_vector_math_layout(uiLayout *layout,
const NodeVectorMathOperation operation = (const NodeVectorMathOperation)node_storage.operation;
uiItemR(layout, ptr, "operation", 0, "", ICON_NONE);
uiItemR(layout, ptr, "input_type_a", 0, IFACE_("Type A"), ICON_NONE);
uiLayoutSetPropSep(layout, true);
uiLayoutSetPropDecorate(layout, false);
uiItemR(layout, ptr, "input_type_a", 0, IFACE_("A"), ICON_NONE);
if (operation_use_input_b(operation)) {
uiItemR(layout, ptr, "input_type_b", 0, IFACE_("Type B"), ICON_NONE);
uiItemR(layout, ptr, "input_type_b", 0, IFACE_("B"), ICON_NONE);
}
if (operation_use_input_c(operation)) {
uiItemR(layout, ptr, "input_type_c", 0, IFACE_("Type C"), ICON_NONE);
uiItemR(layout, ptr, "input_type_c", 0, IFACE_("C"), ICON_NONE);
}
}

View File

@ -44,6 +44,9 @@ static void geo_node_point_rotate_layout(uiLayout *layout, bContext *UNUSED(C),
uiItemR(layout, ptr, "type", UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
uiItemR(layout, ptr, "space", UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
uiLayoutSetPropSep(layout, true);
uiLayoutSetPropDecorate(layout, false);
uiLayout *col = uiLayoutColumn(layout, false);
if (storage->type == GEO_NODE_POINT_ROTATE_TYPE_AXIS_ANGLE) {
uiItemR(col, ptr, "input_type_axis", 0, IFACE_("Axis"), ICON_NONE);

View File

@ -35,6 +35,8 @@ static bNodeSocketTemplate geo_node_point_scale_out[] = {
static void geo_node_point_scale_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayoutSetPropSep(layout, true);
uiLayoutSetPropDecorate(layout, false);
uiItemR(layout, ptr, "input_type", 0, IFACE_("Type"), ICON_NONE);
}

View File

@ -35,6 +35,8 @@ static bNodeSocketTemplate geo_node_point_translate_out[] = {
static void geo_node_point_translate_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayoutSetPropSep(layout, true);
uiLayoutSetPropDecorate(layout, false);
uiItemR(layout, ptr, "input_type", 0, IFACE_("Type"), ICON_NONE);
}