diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-15 08:42:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-15 08:42:23 +0300 |
commit | eb8458b064c5a7553a3bd51c214c9669aaf550f9 (patch) | |
tree | 85063dfae53b799f6bceca854ecb4f338458d833 /source/blender/editors/space_view3d/view3d_toolbar.c | |
parent | acd7b81c2d3fa7828d28c1562fad10663d911783 (diff) |
Centralized operator UI drawing into a new function uiLayoutOperatorButs(),
Operator drawing calls were duplicated in file selector panel, redo panels, redo & dialog popups.
note, uiDefAutoButsRNA's column's argument was misleading, renamed to label_align.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_toolbar.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_toolbar.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index a20397aa720..56ca1ce8280 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -78,29 +78,7 @@ static wmOperator *view3d_last_operator(const bContext *C) static void view3d_panel_operator_redo_buts(const bContext *C, Panel *pa, wmOperator *op) { - wmWindowManager *wm= CTX_wm_manager(C); - PointerRNA ptr; - - if(!op->properties) { - IDPropertyTemplate val = {0}; - op->properties= IDP_New(IDP_GROUP, val, "wmOperatorProperties"); - } - - /* poll() on this operator may still fail, at the moment there is no nice feedback when this happens - * just fails silently */ - if(!WM_operator_repeat_check(C, op)) { - uiBlockSetButLock(uiLayoutGetBlock(pa->layout), TRUE, "Operator cannot redo"); - uiItemL(pa->layout, "* Redo Unsupported *", 0); // XXX, could give some nicer feedback or not show redo panel at all? - } - - RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); - if(op->type->ui) { - op->layout= pa->layout; - op->type->ui((bContext*)C, op); - op->layout= NULL; - } - else - uiDefAutoButsRNA(pa->layout, &ptr, 1); + uiLayoutOperatorButs(C, pa->layout, op, NULL, 'V', 0); } static void view3d_panel_operator_redo_header(const bContext *C, Panel *pa) |