Skip to content

Commit

Permalink
Import model on drop
Browse files Browse the repository at this point in the history
  • Loading branch information
dvsku committed Jan 27, 2024
1 parent 5e9dfbd commit cc4993d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/devue_app/src/gui/dv_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,15 @@ void dv_gui::on_mouse_move(double dx, double dy) {
}
}

void dv_gui::on_drop(int count, const char* paths[]) {
for (int i = 0; i < count; i++) {
if (!m_sytems.model.is_supported_file_type(paths[i])) continue;

std::string dir = std::filesystem::path(paths[i]).remove_filename().string();
m_sytems.model.import(paths[i], dir);
}
}

void dv_gui::set_theme() {
ImGuiStyle& style = ImGui::GetStyle();
ImVec4* colors = style.Colors;
Expand Down
1 change: 1 addition & 0 deletions src/devue_app/src/gui/dv_gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace devue {
void on_scroll(double dx, double dy) override final;
void on_mouse_button(int btn, int action, int modifier) override final;
void on_mouse_move(double dx, double dy) override final;
void on_drop(int count, const char* paths[]) override final;

void set_theme();

Expand Down

0 comments on commit cc4993d

Please sign in to comment.