Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_image/space_image.c
| Show First 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | |||||
| static void image_keymap(struct wmKeyConfig *keyconf) | static void image_keymap(struct wmKeyConfig *keyconf) | ||||
| { | { | ||||
| WM_keymap_ensure(keyconf, "Image Generic", SPACE_IMAGE, 0); | WM_keymap_ensure(keyconf, "Image Generic", SPACE_IMAGE, 0); | ||||
| WM_keymap_ensure(keyconf, "Image", SPACE_IMAGE, 0); | WM_keymap_ensure(keyconf, "Image", SPACE_IMAGE, 0); | ||||
| } | } | ||||
| /* dropboxes */ | /* dropboxes */ | ||||
| static bool image_drop_poll(bContext *UNUSED(C), | static bool image_drop_poll(bContext *C, | ||||
| wmDrag *drag, | wmDrag *drag, | ||||
| const wmEvent *UNUSED(event), | const wmEvent *event, | ||||
| const char **UNUSED(tooltip)) | const char **UNUSED(tooltip)) | ||||
| { | { | ||||
| ScrArea *area = CTX_wm_area(C); | |||||
| if (ED_region_overlap_isect_any_xy(area, &event->x)) { | |||||
| return false; | |||||
| } | |||||
| if (drag->type == WM_DRAG_PATH) { | if (drag->type == WM_DRAG_PATH) { | ||||
| /* rule might not work? */ | /* rule might not work? */ | ||||
| if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) { | if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) { | ||||
| return 1; | return true; | ||||
| } | } | ||||
| } | } | ||||
| return 0; | return false; | ||||
| } | } | ||||
| static void image_drop_copy(wmDrag *drag, wmDropBox *drop) | static void image_drop_copy(wmDrag *drag, wmDropBox *drop) | ||||
| { | { | ||||
| /* copy drag path to properties */ | /* copy drag path to properties */ | ||||
| RNA_string_set(drop->ptr, "filepath", drag->path); | RNA_string_set(drop->ptr, "filepath", drag->path); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 888 Lines • Show Last 20 Lines | |||||