GUI: fix new folder in sample list not working
This commit is contained in:
parent
8a7295fd86
commit
cf4a2fa902
|
@ -934,6 +934,7 @@ void FurnaceGUI::drawSampleList(bool asChild) {
|
||||||
// - delete: 4
|
// - delete: 4
|
||||||
float buttonSize=ImGui::GetStyle().FramePadding.x*2.0f+settings.iconSize*dpiScale+ImGui::GetStyle().ItemSpacing.x;
|
float buttonSize=ImGui::GetStyle().FramePadding.x*2.0f+settings.iconSize*dpiScale+ImGui::GetStyle().ItemSpacing.x;
|
||||||
float buttonSpace=ImGui::GetContentRegionAvail().x/MAX(1.0f,buttonSize);
|
float buttonSpace=ImGui::GetContentRegionAvail().x/MAX(1.0f,buttonSize);
|
||||||
|
bool mustOpenNewFolder=false;
|
||||||
|
|
||||||
if (buttonSpace>=2.0f) {
|
if (buttonSpace>=2.0f) {
|
||||||
// add
|
// add
|
||||||
|
@ -1039,8 +1040,7 @@ void FurnaceGUI::drawSampleList(bool asChild) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ImGui::Button(ICON_FA_FOLDER "##SampleFolder")) {
|
if (ImGui::Button(ICON_FA_FOLDER "##SampleFolder")) {
|
||||||
folderString="";
|
mustOpenNewFolder=true;
|
||||||
ImGui::OpenPopup("NewSampleFolder");
|
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
ImGui::SetTooltip(_("New folder"));
|
ImGui::SetTooltip(_("New folder"));
|
||||||
|
@ -1124,8 +1124,7 @@ void FurnaceGUI::drawSampleList(bool asChild) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ImGui::MenuItem("new folder")) {
|
if (ImGui::MenuItem("new folder")) {
|
||||||
folderString="";
|
mustOpenNewFolder=true;
|
||||||
ImGui::OpenPopup("NewSampleFolder");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1145,6 +1144,11 @@ void FurnaceGUI::drawSampleList(bool asChild) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mustOpenNewFolder) {
|
||||||
|
folderString="";
|
||||||
|
ImGui::OpenPopup("NewSampleFolder");
|
||||||
|
}
|
||||||
|
|
||||||
if (ImGui::BeginPopup("NewSampleFolder",ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings)) {
|
if (ImGui::BeginPopup("NewSampleFolder",ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings)) {
|
||||||
ImGui::InputText("##FolderName",&folderString);
|
ImGui::InputText("##FolderName",&folderString);
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
|
Loading…
Reference in a new issue