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 From 1e590234f7a601ebb5ef93058ae9d4523624a614 Mon Sep 17 00:00:00 2001 From: Yevgeny Makarov Date: Wed, 3 Nov 2021 17:54:03 +0100 Subject: UI: Fix padding of version label in splash screen Differential Revision: D13018 --- source/blender/windowmanager/intern/wm_splash_screen.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_splash_screen.c b/source/blender/windowmanager/intern/wm_splash_screen.c index a4ec9e8fe6e..7513e4d31cc 100644 --- a/source/blender/windowmanager/intern/wm_splash_screen.c +++ b/source/blender/windowmanager/intern/wm_splash_screen.c @@ -212,8 +212,10 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *region, void *UNUSE UI_but_func_set(but, wm_block_close, block, NULL); - wm_block_splash_add_label( - block, BKE_blender_version_string(), splash_width, splash_height - 13.0 * U.dpi_fac); + wm_block_splash_add_label(block, + BKE_blender_version_string(), + splash_width - 8.0 * U.dpi_fac, + splash_height - 13.0 * U.dpi_fac); const int layout_margin_x = U.dpi_fac * 26; uiLayout *layout = UI_block_layout(block, -- cgit v1.2.3