Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_eyedropper.c
| Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| if (name[0] == '\0') { | if (name[0] == '\0') { | ||||
| return; | return; | ||||
| } | } | ||||
| eyedropper_draw_cursor_text_ex(x, y, name); | eyedropper_draw_cursor_text_ex(x, y, name); | ||||
| } | } | ||||
| /** | |||||
| * Utility to retrieve a button representing a RNA property that is currently under the cursor. | |||||
| * | |||||
| * This is to be used by any eyedroppers which fetch properties (e.g. UI_OT_eyedropper_driver). | |||||
| * Especially during modal operations (e.g. as with the eyedroppers), context cannot be relied | |||||
| * upon to provide this information, as it is not updated until the operator finishes. | |||||
| * | |||||
| * \return A button under the mouse which relates to some RNA Property, or NULL | |||||
| */ | |||||
| uiBut *eyedropper_get_property_button_under_mouse(bContext *C, const wmEvent *event) | uiBut *eyedropper_get_property_button_under_mouse(bContext *C, const wmEvent *event) | ||||
| { | { | ||||
| bScreen *screen = CTX_wm_screen(C); | bScreen *screen = CTX_wm_screen(C); | ||||
| ScrArea *area = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, event->xy[0], event->xy[1]); | ScrArea *area = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, event->xy[0], event->xy[1]); | ||||
| const ARegion *region = BKE_area_find_region_xy(area, RGN_TYPE_ANY, event->xy[0], event->xy[1]); | const ARegion *region = BKE_area_find_region_xy(area, RGN_TYPE_ANY, event->xy[0], event->xy[1]); | ||||
| uiBut *but = ui_but_find_mouse_over(region, event); | uiBut *but = ui_but_find_mouse_over(region, event); | ||||
| Show All 28 Lines | |||||