From b73993bcc942cafb8ed4a4610d64286505bb4e11 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Wed, 27 Oct 2021 15:50:14 +0200 Subject: UI: Refactor how dragging onto text buttons works, fixing issues There was a bunch of special handling to support dropping data-blocks onto string or search-menu buttons, to change the value of these. This refactor makes that case use the normal drop-box design, where an operator is executed on drop that gets input properties set by the drop-box. This should also make it easier to add support for dragging assets into these buttons. In addition this fixes an issue: Two tooltips were shown when dragging assets over text buttons. None should be shown, because this isn't supported. --- source/blender/windowmanager/intern/wm_dragdrop.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c index df6d3d5e9e7..37a101cc31d 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@ -821,10 +821,7 @@ static void wm_drag_draw_tooltip(bContext *C, wmWindow *win, wmDrag *drag, const const char *tooltip = NULL; bool free_tooltip = false; - if (UI_but_active_drop_name(C)) { - tooltip = IFACE_("Paste name"); - } - else if (drag->active_dropbox) { + if (drag->active_dropbox) { tooltip = dropbox_tooltip(C, drag, xy, drag->active_dropbox); free_tooltip = true; } @@ -907,7 +904,6 @@ void wm_drags_draw(bContext *C, wmWindow *win) xy[1] = win->eventstate->xy[1]; } - /* Set a region. It is used in the `UI_but_active_drop_name`. */ bScreen *screen = CTX_wm_screen(C); ScrArea *area = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, UNPACK2(xy)); ARegion *region = BKE_area_find_region_xy(area, RGN_TYPE_ANY, UNPACK2(xy)); -- cgit v1.2.3