Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-10-27 16:50:14 +0300
committerJulian Eisel <julian@blender.org>2021-11-03 17:00:17 +0300
commitb73993bcc942cafb8ed4a4610d64286505bb4e11 (patch)
tree19d679910a4ac15cb52bdb25de9a30e10273ce18 /source/blender/windowmanager
parent0d8f1414a21a9c7a3498fd65ce5cd02673582eed (diff)
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.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_dragdrop.c6
1 files changed, 1 insertions, 5 deletions
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));