summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2024-03-12 21:45:35 +0100
committerAldrik Ramaekers <aldrikboy@gmail.com>2024-03-12 21:45:35 +0100
commite72c327a84d1937c05cc14a5e2ab232584e2cb9d (patch)
tree96d58fa0f0065c577bcc87bc094498d2348b3ca3 /src/main.cpp
parente4d2929604792b135cbf8dad22179a5dec60e365 (diff)
dragdrop file work
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 4520d9c..4365f2a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -500,7 +500,25 @@ void ts_create_gui(int window_w, int window_h) {
}
pos_y += textbox_area_height + 7;
- if (current_search_result)
+ if (dragdrop_data.did_drop) {
+ printf("Do loading..\n");
+ dragdrop_data.did_drop = false;
+ }
+
+ if (dragdrop_data.is_dragging_file)
+ {
+ if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceExtern)) // we use an external source (i.e. not ImGui-created)
+ {
+ ImGui::SetDragDropPayload("FILES", nullptr, 0);
+ ImGui::BeginTooltip();
+ ImGui::Text("Drop to load file");
+ ImGui::EndTooltip();
+ ImGui::EndDragDropSource();
+ }
+
+ ImGui::Text("Drag test");
+ }
+ else if (current_search_result)
{ // Results
ImGui::SetNextWindowPos({5, pos_y});