[Bf-blender-cvs] [a363d64b93c] master: UI: Use correct property split ratio for node socket buttons

Hans Goudey noreply at git.blender.org
Wed Mar 24 17:36:31 CET 2021


Commit: a363d64b93cdebff92f2c84d4382d1227cf4425c
Author: Hans Goudey
Date:   Wed Mar 24 12:36:19 2021 -0400
Branches: master
https://developer.blender.org/rBa363d64b93cdebff92f2c84d4382d1227cf4425c

UI: Use correct property split ratio for node socket buttons

This makes the buttons drawn on nodes for unconnected string and color
sockets draw with the correct 40% ratio for the label split rather than
the old 50% ratio not used elsewhere in Blender anymore. The benefit is
a cleaner look, because the button edges line up better with others, and
a bit more space to type in attribute names.

===================================================================

M	source/blender/editors/space_node/drawnode.c

===================================================================

diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 1354c06305c..6864d34885a 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -3429,13 +3429,13 @@ static void std_node_socket_draw(
       }
       break;
     case SOCK_RGBA: {
-      uiLayout *row = uiLayoutSplit(layout, 0.5f, false);
+      uiLayout *row = uiLayoutSplit(layout, 0.4f, false);
       uiItemL(row, text, 0);
       uiItemR(row, ptr, "default_value", DEFAULT_FLAGS, "", 0);
       break;
     }
     case SOCK_STRING: {
-      uiLayout *row = uiLayoutSplit(layout, 0.5f, false);
+      uiLayout *row = uiLayoutSplit(layout, 0.4f, false);
       uiItemL(row, text, 0);
 
       const bNodeTree *node_tree = (const bNodeTree *)node_ptr->owner_id;



More information about the Bf-blender-cvs mailing list