IO: Add support for multiple drag-n-drop files #107230
|
@ -1175,8 +1175,8 @@ struct wmDragAssetListItem {
|
||||||
struct wmDragPath {
|
struct wmDragPath {
|
||||||
blender::Vector<std::string> paths;
|
blender::Vector<std::string> paths;
|
||||||
/* Note that even though the enum type uses bit-flags, this should never have multiple type-bits
|
/* 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
|
* set, so `ELEM()` like comparison is possible. For internal use only, and only indicates the
|
||||||
* of first path in `wmDragPath.paths`. */
|
* file type of first path in `wmDragPath.paths`. */
|
||||||
int file_type; /* eFileSel_File_Types */
|
int file_type; /* eFileSel_File_Types */
|
||||||
std::string tooltip;
|
std::string tooltip;
|
||||||
};
|
};
|
||||||
|
|
|
@ -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);
|
path_data->tooltip = fmt::format(TIP_("Dragging {} files."), path_count);
|
||||||
guishe marked this conversation as resolved
Outdated
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return path_data;
|
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
|
/* 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) {
|
if (drag->drop_state.active_dropbox->draw_droptip) {
|
||||||
drag->drop_state.active_dropbox->draw_droptip(C, win, drag, xy);
|
drag->drop_state.active_dropbox->draw_droptip(C, win, drag, xy);
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue
There is no reason to use C-strings here.
std::string
andfmt::format
(extern library we are using since we are not yet on C++20) should be even easier to use.No final point in our UI strings:
"Dragging {} files"