diff options
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | SConstruct | 5 | ||||
-rw-r--r-- | build_files/cmake/cmake_consistency_check_config.py | 1 | ||||
-rw-r--r-- | build_files/scons/config/win32-vc-config.py | 3 | ||||
-rw-r--r-- | extern/gtest/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 42 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 19 |
8 files changed, 71 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 01654e2d983..8ac54c03a5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -366,7 +366,9 @@ if(APPLE) endif() execute_process(COMMAND uname -r OUTPUT_VARIABLE MAC_SYS) # check for actual system-version - if(${MAC_SYS} MATCHES 13) + if(${MAC_SYS} MATCHES 14) + set(OSX_SYSTEM 10.10) + elseif(${MAC_SYS} MATCHES 13) set(OSX_SYSTEM 10.9) elseif(${MAC_SYS} MATCHES 12) set(OSX_SYSTEM 10.8) @@ -1336,9 +1338,9 @@ elseif(WIN32) find_package(OpenImageIO) set(OPENIMAGEIO ${LIBDIR}/openimageio) set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include) - set(OIIO_OPTIMIZED OpenImageIO OpenImageIO_Util) - set(OIIO_DEBUG OpenImageIO_d OpenImageIO_Util_d) - set(OPENIMAGEIO_LIBRARIES optimized ${OIIO_OPTIMIZED} debug ${OIIO_DEBUG}) + set(OIIO_OPTIMIZED optimized OpenImageIO optimized OpenImageIO_Util) + set(OIIO_DEBUG debug OpenImageIO_d debug OpenImageIO_Util_d) + set(OPENIMAGEIO_LIBRARIES ${OIIO_OPTIMIZED} ${OIIO_DEBUG}) set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib) set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0") endif() diff --git a/SConstruct b/SConstruct index 98352b006a3..60513bf0541 100644 --- a/SConstruct +++ b/SConstruct @@ -323,7 +323,10 @@ if env['OURPLATFORM']=='darwin': print B.bc.OKGREEN + "Available SDK's: \n" + B.bc.ENDC + MACOSX_SDK_CHECK.replace('\t', '') if env['MACOSX_SDK'] == '': # no set sdk, choosing best one found - if 'OS X 10.9' in MACOSX_SDK_CHECK: + if 'OS X 10.10' in MACOSX_SDK_CHECK: + env['MACOSX_DEPLOYMENT_TARGET'] = '10.6' + env['MACOSX_SDK']='/Developer/SDKs/MacOSX10.10.sdk' + elif 'OS X 10.9' in MACOSX_SDK_CHECK: env['MACOSX_DEPLOYMENT_TARGET'] = '10.6' env['MACOSX_SDK']='/Developer/SDKs/MacOSX10.9.sdk' elif 'OS X 10.8' in MACOSX_SDK_CHECK: diff --git a/build_files/cmake/cmake_consistency_check_config.py b/build_files/cmake/cmake_consistency_check_config.py index 55bad251a53..729eecce233 100644 --- a/build_files/cmake/cmake_consistency_check_config.py +++ b/build_files/cmake/cmake_consistency_check_config.py @@ -2,6 +2,7 @@ import os IGNORE = ( "/test/", + "/tests/gtests/", "/BSP_GhostTest/", "/release/", "/xembed/", diff --git a/build_files/scons/config/win32-vc-config.py b/build_files/scons/config/win32-vc-config.py index c036bf317cb..b6d582087f6 100644 --- a/build_files/scons/config/win32-vc-config.py +++ b/build_files/scons/config/win32-vc-config.py @@ -154,7 +154,7 @@ BF_COLLADA_LIB = 'bf_collada' BF_OPENCOLLADA = LIBDIR + '/opencollada' BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada' -BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa UTF' +BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa' BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada' WITH_BF_3DMOUSE = True @@ -263,3 +263,4 @@ if VC_VERSION == '12.0': else: BF_BUILDDIR = '..\\build\\win32-vc9' BF_INSTALLDIR='..\\install\\win32-vc9' + BF_OPENCOLLADA_LIB = BF_OPENCOLLADA_LIB + ' UTF' diff --git a/extern/gtest/CMakeLists.txt b/extern/gtest/CMakeLists.txt index b5e40027513..86f2aaa314a 100644 --- a/extern/gtest/CMakeLists.txt +++ b/extern/gtest/CMakeLists.txt @@ -39,6 +39,7 @@ set(SRC src/gtest-test-part.cc src/gtest-typed-test.cc + src/gtest-internal-inl.h include/gtest/gtest-death-test.h include/gtest/gtest.h include/gtest/gtest-message.h diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index b3f13ccdb35..b5f11c2a0f9 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -385,7 +385,7 @@ void ui_pan_to_scroll(const wmEvent *event, int *type, int *val) } } -static bool ui_but_is_editable(const uiBut *but) +bool ui_but_is_editable(const uiBut *but) { return !ELEM(but->type, LABEL, SEPR, SEPRLINE, ROUNDBOX, LISTBOX, PROGRESSBAR); } @@ -7199,6 +7199,17 @@ void ui_button_activate_do(bContext *C, ARegion *ar, uiBut *but) ui_do_button(C, but->block, but, &event); } +/** + * Simulate moving the mouse over a button (or navigating to it with arrow keys). + * + * exported so menus can start with a highlighted button, + * even if the mouse isnt over it + */ +void ui_button_activate_over(bContext *C, ARegion *ar, uiBut *but) +{ + button_activate_init(C, ar, but, BUTTON_ACTIVATE_OVER); +} + void ui_button_execute_begin(struct bContext *UNUSED(C), struct ARegion *ar, uiBut *but, void **active_back) { /* note: ideally we would not have to change 'but->active' however @@ -7261,12 +7272,20 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but) retval = WM_UI_HANDLER_CONTINUE; break; case MOUSEMOVE: - /* verify if we are still over the button, if not exit */ - if (!ui_mouse_inside_button(ar, but, event->x, event->y)) { - data->cancel = true; - button_activate_state(C, but, BUTTON_STATE_EXIT); + { + uiBut *but_other = ui_but_find_mouse_over(ar, event); + bool exit = false; + + if (!ui_block_is_menu(block) && + !ui_mouse_inside_button(ar, but, event->x, event->y)) + { + exit = true; + } + else if (but_other && ui_but_is_editable(but_other) && (but_other != but)) { + exit = true; } - else if (ui_but_find_mouse_over(ar, event) != but) { + + if (exit) { data->cancel = true; button_activate_state(C, but, BUTTON_STATE_EXIT); } @@ -7277,6 +7296,7 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but) } break; + } case TIMER: { /* handle tooltip timer */ @@ -7860,6 +7880,16 @@ static int ui_handle_menu_button(bContext *C, const wmEvent *event, uiPopupBlock int retval; if (but) { + /* Its possible there is an active menu item NOT under the mouse, + * in this case ignore mouse clicks outside the button (but Enter etc is accepted) */ + if ((event->type != MOUSEMOVE) && ISMOUSE(event->type)) { + if (!ui_mouse_inside_button(but->active->region, but, event->x, event->y)) { + but = NULL; + } + } + } + + if (but) { ScrArea *ctx_area = CTX_wm_area(C); ARegion *ctx_region = CTX_wm_region(C); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index fa8b6b1ffee..7d03aaea6b3 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -552,6 +552,7 @@ void ui_draw_but_NODESOCKET(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol PointerRNA *ui_handle_afterfunc_add_operator(struct wmOperatorType *ot, int opcontext, bool create_props); extern void ui_pan_to_scroll(const struct wmEvent *event, int *type, int *val); extern void ui_button_activate_do(struct bContext *C, struct ARegion *ar, uiBut *but); +extern void ui_button_activate_over(struct bContext *C, struct ARegion *ar, uiBut *but); extern void ui_button_execute_begin(struct bContext *C, struct ARegion *ar, uiBut *but, void **active_back); extern void ui_button_execute_end(struct bContext *C, struct ARegion *ar, uiBut *but, void *active_back); extern void ui_button_active_free(const struct bContext *C, uiBut *but); @@ -559,6 +560,7 @@ extern bool ui_button_is_active(struct ARegion *ar) ATTR_WARN_UNUSED_RESULT; extern int ui_button_open_menu_direction(uiBut *but); extern void ui_button_text_password_hide(char password_str[UI_MAX_DRAW_STR], uiBut *but, const bool restore); extern uiBut *ui_but_find_activated(struct ARegion *ar); +bool ui_but_is_editable(const uiBut *but); void ui_button_clipboard_free(void); void ui_panel_menu(struct bContext *C, ARegion *ar, Panel *pa); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 85bf15e15cf..32fb684f2b6 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2408,6 +2408,7 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT); if (pup->popup) { + uiBut *but_activate = NULL; uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_NUMSELECT); uiBlockSetDirection(block, direction); @@ -2421,6 +2422,10 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi * block to be under the mouse */ offset[0] = -(bt->rect.xmin + 0.8f * BLI_rctf_size_x(&bt->rect)); offset[1] = -(bt->rect.ymin + 0.5f * UI_UNIT_Y); + + if (ui_but_is_editable(bt)) { + but_activate = bt; + } } else { /* position mouse at 0.8*width of the button and below the tile @@ -2430,6 +2435,20 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi offset[0] = min_ii(offset[0], -(bt->rect.xmin + 0.8f * BLI_rctf_size_x(&bt->rect))); offset[1] = 2.1 * UI_UNIT_Y; + + for (bt = block->buttons.first; bt; bt = bt->next) { + if (ui_but_is_editable(bt)) { + but_activate = bt; + break; + } + } + } + + /* in rare cases this is needed since moving the popup + * to be within the window bounds may move it away from the mouse, + * This ensures we set an item to be active. */ + if (but_activate) { + ui_button_activate_over(C, handle->region, but_activate); } block->minbounds = minwidth; |