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:
authorCampbell Barton <ideasman42@gmail.com>2020-07-16 10:00:16 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-07-16 10:00:16 +0300
commitad4928a1710fe96749484b3823513d3f7c5624aa (patch)
tree71b4fb484048411c8ce57f5818b3135cbf2e5f2e /source/blender/editors/interface
parent75520894c72ae8ee96cda7ed8cf8ac642c4f31ab (diff)
UI: avoid aligning labels for ui_item_with_label
Key-map display was doing thousands of redundant alignment operations. Set the spacing instead as align was only set to use zero spacing. This would have prevented the crash reported by T78636.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_layout.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 858b48ba9fa..f027a62cbfd 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -947,8 +947,11 @@ static uiBut *ui_item_with_label(uiLayout *layout,
const bool use_prop_sep = ((layout->item.flag & UI_ITEM_PROP_SEP) != 0);
#endif
- /* Always align item with label since text is already given enough space not to overlap. */
- sub = uiLayoutRow(layout, true);
+ /* Previously 'align' was enabled to make sure the label is spaced closely to the button.
+ * Set the space to zero instead as aligning a large number of labels can end up aligning
+ * thousands of buttons when displaying key-map search (a heavy operation), see: T78636. */
+ sub = uiLayoutRow(layout, false);
+ sub->space = 0;
UI_block_layout_set_current(block, sub);
#ifdef UI_PROP_DECORATE