diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2019-11-26 21:43:36 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-11-26 21:47:13 +0300 |
commit | b16018f637b35ba17f0515111fe5c450c5476105 (patch) | |
tree | fe2b0346ac9d6836765d5cedad1459b00d3a19fd /source/blender/editors/interface | |
parent | 2bbdf586d5ff1682c7a744d1282dfd41aba78390 (diff) |
Fix preview Template-ID broken in vertical layouts
Old code worked pure "by luck". I fixed an error in rB5bcb0c993503 that
made this "luck" go away. Special handling is needed for the preview
layout.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 5788b741108..956fd4514af 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -156,6 +156,13 @@ static void template_add_button_search_menu(const bContext *C, const bool use_preview_icon = use_big_size || (id && (GS(id->name) != ID_SCR)); const short width = UI_UNIT_X * (use_big_size ? 6 : 1.6f); const short height = UI_UNIT_Y * (use_big_size ? 6 : 1); + uiLayout *col = NULL; + + if (use_big_size) { + /* Assume column layout here. To be more correct, we should check if the layout passed to + * template_id is a column one, but this should work well in practice. */ + col = uiLayoutColumn(layout, true); + } but = uiDefBlockButN(block, block_func, block_argN, "", 0, 0, width, height, tip); if (use_preview_icon) { @@ -171,7 +178,7 @@ static void template_add_button_search_menu(const bContext *C, UI_but_flag_enable(but, UI_BUT_DISABLED); } if (use_big_size) { - uiLayoutRow(layout, true); + uiLayoutRow(col ? col : layout, true); } } else { |