Skip to content

Commit cc4993d

Browse files
committed
Import model on drop
1 parent 5e9dfbd commit cc4993d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/devue_app/src/gui/dv_gui.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,15 @@ void dv_gui::on_mouse_move(double dx, double dy) {
300300
}
301301
}
302302

303+
void dv_gui::on_drop(int count, const char* paths[]) {
304+
for (int i = 0; i < count; i++) {
305+
if (!m_sytems.model.is_supported_file_type(paths[i])) continue;
306+
307+
std::string dir = std::filesystem::path(paths[i]).remove_filename().string();
308+
m_sytems.model.import(paths[i], dir);
309+
}
310+
}
311+
303312
void dv_gui::set_theme() {
304313
ImGuiStyle& style = ImGui::GetStyle();
305314
ImVec4* colors = style.Colors;

src/devue_app/src/gui/dv_gui.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ namespace devue {
2424
void on_scroll(double dx, double dy) override final;
2525
void on_mouse_button(int btn, int action, int modifier) override final;
2626
void on_mouse_move(double dx, double dy) override final;
27+
void on_drop(int count, const char* paths[]) override final;
2728

2829
void set_theme();
2930

0 commit comments

Comments
 (0)