diff options
author | Joshua Leung <aligorith@gmail.com> | 2018-06-11 10:39:34 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2018-06-11 10:43:28 +0300 |
commit | 21c24c0423b4c82eb3baa18bd7474acc2a5a81bf (patch) | |
tree | f789f98387553918f0d473707307cd4fdd17cee8 /source/blender/editors/space_graph | |
parent | 5843de3251464f77b68bc113efe6f0a6bfc9a1c9 (diff) |
Drivers UI: Introduce more whitespace, to make the sections clearer
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_buttons.c | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index ee6f6123375..5b9df4de98e 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -778,6 +778,9 @@ static void graph_draw_driver_settings_panel(uiLayout *layout, ID *id, FCurve *f uiItemL(row, valBuf, ICON_NONE); } + uiItemS(layout); + uiItemS(layout); + /* show expression box if doing scripted drivers, and/or error messages when invalid drivers exist */ if (driver->type == DRIVER_TYPE_PYTHON) { bool bpy_data_expr_error = (strstr(driver->expression, "bpy.data.") != NULL); @@ -841,26 +844,38 @@ static void graph_draw_driver_settings_panel(uiLayout *layout, ID *id, FCurve *f } } + uiItemS(layout); + /* add/copy/paste driver variables */ - { + if (is_popover) { + /* add driver variable - add blank */ + row = uiLayoutRow(layout, true); + block = uiLayoutGetBlock(row); + but = uiDefIconTextBut(block, UI_BTYPE_BUT, B_IPO_DEPCHANGE, ICON_ZOOMIN, IFACE_("Add Input Variable"), + 0, 0, 10 * UI_UNIT_X, UI_UNIT_Y, + NULL, 0.0, 0.0, 0, 0, + TIP_("Add a Driver Variable to keep track an input used by the driver")); + UI_but_func_set(but, driver_add_var_cb, driver, NULL); + + /* add driver variable - add using eyedropper */ + /* TODO... */ + } + else { /* add driver variable */ row = uiLayoutRow(layout, false); block = uiLayoutGetBlock(row); but = uiDefIconTextBut(block, UI_BTYPE_BUT, B_IPO_DEPCHANGE, ICON_ZOOMIN, IFACE_("Add Input Variable"), - 0, 0, 10 * UI_UNIT_X, UI_UNIT_Y, - NULL, 0.0, 0.0, 0, 0, - TIP_("Driver variables ensure that all dependencies will be accounted for, eusuring that drivers will update correctly")); + 0, 0, 10 * UI_UNIT_X, UI_UNIT_Y, + NULL, 0.0, 0.0, 0, 0, + TIP_("Driver variables ensure that all dependencies will be accounted for, eusuring that drivers will update correctly")); UI_but_func_set(but, driver_add_var_cb, driver, NULL); /* copy/paste (as sub-row) */ - if (is_popover == false) { - /* only in the drivers editor proper for now, as these depend on the active F-Curve */ - row = uiLayoutRow(row, true); - block = uiLayoutGetBlock(row); + row = uiLayoutRow(row, true); + block = uiLayoutGetBlock(row); - uiItemO(row, "", ICON_COPYDOWN, "GRAPH_OT_driver_variables_copy"); - uiItemO(row, "", ICON_PASTEDOWN, "GRAPH_OT_driver_variables_paste"); - } + uiItemO(row, "", ICON_COPYDOWN, "GRAPH_OT_driver_variables_copy"); + uiItemO(row, "", ICON_PASTEDOWN, "GRAPH_OT_driver_variables_paste"); } /* loop over targets, drawing them */ @@ -951,6 +966,9 @@ static void graph_draw_driver_settings_panel(uiLayout *layout, ID *id, FCurve *f } } + uiItemS(layout); + uiItemS(layout); + /* XXX: This should become redundant. But sometimes the flushing fails, so keep this around for a while longer as a "last resort" */ row = uiLayoutRow(layout, true); block = uiLayoutGetBlock(row); |