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:
authorAntonioya <blendergit@gmail.com>2018-11-02 18:32:31 +0300
committerAntonioya <blendergit@gmail.com>2018-11-02 18:35:53 +0300
commitf3ffb4e0499d23df127f316f3767a35e551e7ed1 (patch)
treea97b41e64acaf968a79d0704cb42d4791ec3bdb0 /source/blender/editors/interface/interface_layout.c
parentd3ade457745023af22ec1bb09e94e334f06208ad (diff)
Add new factor parameter to layout.separator()
The new parameter allows to define the scale of the space.
Diffstat (limited to 'source/blender/editors/interface/interface_layout.c')
-rw-r--r--source/blender/editors/interface/interface_layout.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 973a47c5305..41df694176a 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -2419,16 +2419,23 @@ void uiItemV(uiLayout *layout, const char *name, int icon, int argval)
}
/* separator item */
-void uiItemS(uiLayout *layout)
+void uiItemS_ex(uiLayout *layout, float factor)
{
uiBlock *block = layout->root->block;
bool is_menu = ui_block_is_menu(block);
int space = (is_menu) ? 0.45f * UI_UNIT_X : 0.3f * UI_UNIT_X;
+ space *= factor;
UI_block_layout_set_current(block, layout);
uiDefBut(block, (is_menu) ? UI_BTYPE_SEPR_LINE : UI_BTYPE_SEPR, 0, "", 0, 0, space, space, NULL, 0.0, 0.0, 0, 0, "");
}
+/* separator item */
+void uiItemS(uiLayout *layout)
+{
+ uiItemS_ex(layout, 1.0f);
+}
+
/* Flexible spacing. */
void uiItemSpacer(uiLayout *layout)
{