Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_common.py4
-rw-r--r--source/blender/editors/interface/interface_layout.c17
2 files changed, 18 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py
index 83bfab5581d..9653d98d428 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -239,11 +239,11 @@ def effector_weights_ui(self, context, weights, weight_type):
layout = self.layout
layout.use_property_split = True
- layout.prop(weights, "group")
-
# NOTE: TODO temporarly used until the animate properties are properly skipped.
layout.use_property_decorate = False # No animation (remove this later on).
+ layout.prop(weights, "group")
+
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
col = flow.column()
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index ec35325416a..a9703736916 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -809,6 +809,11 @@ static uiBut *ui_item_with_label(
x, y, prop_but_width, h);
}
+ /* Only for alignment. */
+ if ((layout->item.flag & UI_ITEM_PROP_DECORATE) != 0) {
+ uiItemL(sub, NULL, ICON_BLANK1);
+ }
+
UI_block_layout_set_current(block, layout);
return but;
}
@@ -1509,6 +1514,8 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index
#ifdef UI_PROP_DECORATE
struct {
bool use_prop_decorate;
+ /* For button types that handle own decorations (or add own padding for alignment). */
+ bool use_prop_decorate_done;
int len;
uiLayout *layout;
uiBut *but;
@@ -1728,6 +1735,11 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index
if (layout->redalert)
UI_but_flag_enable(but, UI_BUT_REDALERT);
+
+#ifdef UI_PROP_DECORATE
+ /* ui_item_with_label handles this. */
+ ui_decorate.use_prop_decorate_done = true;
+#endif
}
/* single button */
else {
@@ -1749,7 +1761,10 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index
}
#ifdef UI_PROP_DECORATE
- if (ui_decorate.use_prop_decorate) {
+ if (ui_decorate.use_prop_decorate_done) {
+ /* pass */
+ }
+ else if (ui_decorate.use_prop_decorate) {
const bool is_anim = RNA_property_animateable(ptr, prop);
uiBut *but_decorate = ui_decorate.but ? ui_decorate.but->next : block->buttons.first;
uiLayout *layout_col = uiLayoutColumn(ui_decorate.layout, false);