GUI: create folder in dynamic buttons
This commit is contained in:
parent
4bd72574cf
commit
8a7295fd86
|
@ -1040,19 +1040,7 @@ void FurnaceGUI::drawSampleList(bool asChild) {
|
||||||
} else {
|
} else {
|
||||||
if (ImGui::Button(ICON_FA_FOLDER "##SampleFolder")) {
|
if (ImGui::Button(ICON_FA_FOLDER "##SampleFolder")) {
|
||||||
folderString="";
|
folderString="";
|
||||||
}
|
ImGui::OpenPopup("NewSampleFolder");
|
||||||
if (ImGui::BeginPopupContextItem("NewSampleFolder",ImGuiMouseButton_Left)) {
|
|
||||||
ImGui::InputText("##FolderName",&folderString);
|
|
||||||
ImGui::SameLine();
|
|
||||||
ImGui::BeginDisabled(folderString.empty());
|
|
||||||
if (ImGui::Button(_("Create"))) {
|
|
||||||
e->lockEngine([this]() {
|
|
||||||
e->song.sampleDir.push_back(DivAssetDir(folderString));
|
|
||||||
});
|
|
||||||
ImGui::CloseCurrentPopup();
|
|
||||||
}
|
|
||||||
ImGui::EndDisabled();
|
|
||||||
ImGui::EndPopup();
|
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
ImGui::SetTooltip(_("New folder"));
|
ImGui::SetTooltip(_("New folder"));
|
||||||
|
@ -1136,7 +1124,8 @@ void FurnaceGUI::drawSampleList(bool asChild) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ImGui::MenuItem("new folder")) {
|
if (ImGui::MenuItem("new folder")) {
|
||||||
showError("to be done...");
|
folderString="";
|
||||||
|
ImGui::OpenPopup("NewSampleFolder");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1156,6 +1145,20 @@ void FurnaceGUI::drawSampleList(bool asChild) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ImGui::BeginPopup("NewSampleFolder",ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings)) {
|
||||||
|
ImGui::InputText("##FolderName",&folderString);
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::BeginDisabled(folderString.empty());
|
||||||
|
if (ImGui::Button(_("Create"))) {
|
||||||
|
e->lockEngine([this]() {
|
||||||
|
e->song.sampleDir.push_back(DivAssetDir(folderString));
|
||||||
|
});
|
||||||
|
ImGui::CloseCurrentPopup();
|
||||||
|
}
|
||||||
|
ImGui::EndDisabled();
|
||||||
|
ImGui::EndPopup();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
if (ImGui::BeginTable("SampleListScroll",1,ImGuiTableFlags_ScrollY)) {
|
if (ImGui::BeginTable("SampleListScroll",1,ImGuiTableFlags_ScrollY)) {
|
||||||
actualSampleList();
|
actualSampleList();
|
||||||
|
|
Loading…
Reference in a new issue