GUI: display loop length in checkbox

This commit is contained in:
tildearrow 2023-09-08 01:47:49 -05:00
parent f0306ca660
commit ff06ad67bd

View file

@ -434,7 +434,8 @@ void FurnaceGUI::drawSampleEdit() {
ImGui::TableNextColumn();
bool doLoop=(sample->loop);
pushWarningColor(!warnLoop.empty());
if (ImGui::Checkbox("Loop",&doLoop)) { MARK_MODIFIED
String loopCheckboxName=(doLoop && (sample->loopEnd-sample->loopStart)>0)?fmt::sprintf("Loop (length: %d)##Loop",sample->loopEnd-sample->loopStart):String("Loop");
if (ImGui::Checkbox(loopCheckboxName.c_str(),&doLoop)) { MARK_MODIFIED
if (doLoop) {
sample->loop=true;
if (sample->loopStart<0) {