diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/BPY_interface.c | 34 | ||||
-rw-r--r-- | source/blender/python/BPY_menus.c | 4 | ||||
-rw-r--r-- | source/blender/python/BPY_menus.h | 1 |
3 files changed, 23 insertions, 16 deletions
diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index 4a7f347de5b..63e416d86d5 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -612,23 +612,35 @@ int BPY_menu_do_python(short menutype, int event) if (G.obedit) exit_editmode(1); /* let's find a proper area for an eventual script gui: - * preference in order: Script, Buttons (if not a Wizards or Utils script), - * Text, any closest bigger area */ - if (curarea->spacetype != SPACE_SCRIPT) { - ScrArea *sa; + * (still experimenting here, need definition on which win + * each group will be put to code this properly) */ + switch (menutype) { + + case PYMENU_IMPORT: /* first 3 were handled in header_info.c */ + case PYMENU_EXPORT: + case PYMENU_HELP: + case PYMENU_WIZARDS: + break; - sa = find_biggest_area_of_type(SPACE_SCRIPT); + default: + if (curarea->spacetype != SPACE_SCRIPT) { + ScrArea *sa = NULL; - if (!sa) { - if ((menutype != PYMENU_WIZARDS) && (menutype != PYMENU_UTILS)) sa = find_biggest_area_of_type(SPACE_BUTS); - } + if (sa) { + if ((1.5 * sa->winx) < sa->winy) sa = NULL; /* too narrow? */ + } - if (!sa) sa = find_biggest_area_of_type(SPACE_TEXT); + if (!sa) sa = find_biggest_area_of_type(SPACE_SCRIPT); + if (!sa) sa = find_biggest_area_of_type(SPACE_TEXT); + if (!sa) sa = find_biggest_area_of_type(SPACE_IMAGE); /* group UV */ + if (!sa) sa = find_biggest_area_of_type(SPACE_VIEW3D); - if (!sa) sa = closest_bigger_area(); + if (!sa) sa = find_biggest_area(); - areawinset(sa->win); + areawinset(sa->win); + } + break; } script->id.us = 1; diff --git a/source/blender/python/BPY_menus.c b/source/blender/python/BPY_menus.c index 5b5d4269df8..401e15e177d 100644 --- a/source/blender/python/BPY_menus.c +++ b/source/blender/python/BPY_menus.c @@ -84,7 +84,6 @@ static int bpymenu_group_atoi (char *str) else if (!strcmp(str, "Animation")) return PYMENU_ANIMATION; else if (!strcmp(str, "Materials")) return PYMENU_MATERIALS; else if (!strcmp(str, "UV")) return PYMENU_UV; - else if (!strcmp(str, "Utils")) return PYMENU_UTILS; else if (!strcmp(str, "Tools")) return PYMENU_TOOLS; /* "Misc" or an inexistent group name: use misc */ else return PYMENU_MISC; @@ -120,9 +119,6 @@ char *BPyMenu_group_itoa (short menugroup) case PYMENU_UV: return "UV"; break; - case PYMENU_UTILS: - return "Utils"; - break; case PYMENU_TOOLS: return "Tools"; break; diff --git a/source/blender/python/BPY_menus.h b/source/blender/python/BPY_menus.h index d572371bdfc..0c1c20161b4 100644 --- a/source/blender/python/BPY_menus.h +++ b/source/blender/python/BPY_menus.h @@ -79,7 +79,6 @@ typedef struct BPyMenu { typedef enum { PYMENU_WIZARDS, /* complex 'app' scripts */ PYMENU_UV, /* UV editing tools, to go in UV/Image editor space, 'UV' menu */ - PYMENU_UTILS, PYMENU_TOOLS, PYMENU_MODIFIERS, /* modifies existing obj *data* */ PYMENU_MISC, |