From 58cdd37f52591dd47962e00c72564f579e1fc4a7 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 27 Apr 2009 18:05:58 +0000 Subject: UI: * Made separator item work horizontal & vertical. * Add colon (:) automatic for int/float/enum/string. * Added space variables to uiStyle and use them in the layout engine. * Added initial World buttons by Thomas Dinges, thanks! * Added some code for modifiers in the Object Data context. This will become a template though. * Use a common poll() callback in the scripts to reduce code. --- source/blender/editors/interface/interface_regions.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/interface/interface_regions.c') diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 7bc7e2e3c19..59725cc4954 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1763,12 +1763,13 @@ static uiBlock *ui_block_func_MENU_ITEM(bContext *C, uiPopupBlockHandle *handle, uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut *but, uiMenuCreateFunc menu_func, void *arg) { + uiStyle *style= U.uistyles.first; uiPopupBlockHandle *handle; uiPopupMenu *pup; uiMenuInfo info; pup= MEM_callocN(sizeof(uiPopupMenu), "menu dummy"); - pup->layout= uiLayoutBegin(UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0); + pup->layout= uiLayoutBegin(UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style); uiLayoutContext(pup->layout, WM_OP_INVOKE_REGION_WIN); uiLayoutColumn(pup->layout); @@ -1793,10 +1794,11 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut /* only return handler, and set optional title */ uiPopupMenu *uiPupMenuBegin(const char *title, int icon) { + uiStyle *style= U.uistyles.first; uiPopupMenu *pup= MEM_callocN(sizeof(uiPopupMenu), "menu start"); pup->icon= icon; - pup->layout= uiLayoutBegin(UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0); + pup->layout= uiLayoutBegin(UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style); uiLayoutContext(pup->layout, WM_OP_EXEC_REGION_WIN); uiLayoutColumn(pup->layout); -- cgit v1.2.3