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:
authorHarley Acheson <harley>2019-04-25 15:40:53 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-04-25 19:19:47 +0300
commitb89cabb300816427273596736aa45ab9edca76b9 (patch)
tree3527083af1e51ce1cb0c10e7a6117d901b6788a5 /source/blender/editors/interface/interface_layout.c
parent905f2d84af4d200dc23454edc286965808334eb6 (diff)
UI: hide redundant menu separators automatically
Differential Revision: https://developer.blender.org/D4682
Diffstat (limited to 'source/blender/editors/interface/interface_layout.c')
-rw-r--r--source/blender/editors/interface/interface_layout.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index cfedd40bfd1..935d89937e0 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -2968,6 +2968,9 @@ void uiItemS_ex(uiLayout *layout, float factor)
{
uiBlock *block = layout->root->block;
bool is_menu = ui_block_is_menu(block);
+ if (is_menu && !UI_block_can_add_separator(block)) {
+ return;
+ }
int space = (is_menu) ? 0.45f * UI_UNIT_X : 0.3f * UI_UNIT_X;
space *= factor;