From 8e09171d5b7f7a4698b12a2a9561a317a3271606 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 23 Nov 2009 00:56:19 +0000 Subject: [PATCH] temp hack to make the popup show wider when running the edit description operator --- release/scripts/op/wm.py | 4 ++-- .../blender/editors/interface/interface_handlers.c | 4 ++-- source/blender/windowmanager/intern/wm_operators.c | 12 ++++++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py index 7ec66220902..92b1434b696 100644 --- a/release/scripts/op/wm.py +++ b/release/scripts/op/wm.py @@ -248,9 +248,9 @@ class WM_OT_context_cycle_enum(bpy.types.Operator): return ('FINISHED',) doc_id = StringProperty(name="Doc ID", - description="ID for the documentation", maxlen=1024, default="") + description="", maxlen=1024, default="", hidden=True) -doc_new = StringProperty(name="Doc New", +doc_new = StringProperty(name="Edit Description", description="", maxlen=1024, default="") diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index fb4438455bd..6ae5cab1a18 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3497,7 +3497,7 @@ static int ui_but_menu(bContext *C, uiBut *but) RNA_string_set(&ptr_props, "doc_id", buf); RNA_string_set(&ptr_props, "doc_new", RNA_property_description(but->rnaprop)); - uiItemFullO(layout, "Edit Docs (TODO)", 0, "WM_OT_doc_edit", ptr_props.data, WM_OP_INVOKE_DEFAULT, 0); + uiItemFullO(layout, "Submit Description", 0, "WM_OT_doc_edit", ptr_props.data, WM_OP_INVOKE_DEFAULT, 0); } else if (but->optype) { WM_operator_py_idname(buf, but->optype->idname); @@ -3511,7 +3511,7 @@ static int ui_but_menu(bContext *C, uiBut *but) RNA_string_set(&ptr_props, "doc_id", buf); RNA_string_set(&ptr_props, "doc_new", but->optype->description); - uiItemFullO(layout, "Edit Docs (TODO)", 0, "WM_OT_doc_edit", ptr_props.data, WM_OP_INVOKE_DEFAULT, 0); + uiItemFullO(layout, "Submit Description", 0, "WM_OT_doc_edit", ptr_props.data, WM_OP_INVOKE_DEFAULT, 0); } } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index beece8c9226..1b334bc778f 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -699,7 +699,9 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op) uiBlock *block; uiLayout *layout; uiStyle *style= U.uistyles.first; + int columns= 2, width= 300; + block= uiBeginBlock(C, ar, "redo_popup", UI_EMBOSS); uiBlockClearFlag(block, UI_BLOCK_LOOP); uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1); @@ -710,14 +712,20 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op) op->properties= IDP_New(IDP_GROUP, val, "wmOperatorProperties"); } + // XXX - hack, only for editing docs + if(strcmp(op->type->idname, "WM_OT_doc_edit")==0) { + columns= 1; + width= 500; + } + RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); - layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 300, 20, style); + layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, width, 20, style); uiItemL(layout, op->type->name, 0); if(op->type->ui) op->type->ui((bContext*)C, &ptr, layout); else - uiDefAutoButsRNA(C, layout, &ptr, 2); + uiDefAutoButsRNA(C, layout, &ptr, columns); uiPopupBoundsBlock(block, 4.0f, 0, 0); uiEndBlock(C, block);