IO: Add support for multiple drag-n-drop files #107230

Merged
Brecht Van Lommel merged 20 commits from guishe/blender:dragndrop-files into main 2023-12-12 18:46:22 +01:00
2 changed files with 3 additions and 4 deletions
Showing only changes of commit b2b60973ae - Show all commits

View File

@ -1175,8 +1175,8 @@ struct wmDragAssetListItem {
struct wmDragPath {
blender::Vector<std::string> paths;
/* Note that even though the enum type uses bit-flags, this should never have multiple type-bits
* set, so `ELEM()` like comparison is possible. For internal use only, and only indicates the file type
* of first path in `wmDragPath.paths`. */
* set, so `ELEM()` like comparison is possible. For internal use only, and only indicates the
* file type of first path in `wmDragPath.paths`. */
int file_type; /* eFileSel_File_Types */
std::string tooltip;
};

View File

@ -777,7 +777,6 @@ wmDragPath *WM_drag_create_path_data(blender::Span<const char *> paths)
path_data->tooltip = fmt::format(TIP_("Dragging {} files."), path_count);
guishe marked this conversation as resolved Outdated

There is no reason to use C-strings here. std::string and fmt::format (extern library we are using since we are not yet on C++20) should be even easier to use.

There is no reason to use C-strings here. `std::string` and `fmt::format` (extern library we are using since we are not yet on C++20) should be even easier to use.
Review

No final point in our UI strings: "Dragging {} files"

No final point in our UI strings: `"Dragging {} files"`
}
return path_data;
}
@ -1062,7 +1061,7 @@ void wm_drags_draw(bContext *C, wmWindow *win)
}
/* Drawing should be allowed to assume the context from handling and polling (that's why we
restore it above). */
* restore it above). */
if (drag->drop_state.active_dropbox->draw_droptip) {
drag->drop_state.active_dropbox->draw_droptip(C, win, drag, xy);
continue;