diff --git a/BaseToolkit.cpp b/BaseToolkit.cpp index 3e1fb00..85d0e58 100644 --- a/BaseToolkit.cpp +++ b/BaseToolkit.cpp @@ -55,8 +55,17 @@ std::string BaseToolkit::uniqueName(const std::string &basename, std::list 1) - tentativename = basename + "_" + std::to_string( count ); + if (count > 1) { + // check if the name is ending by "_i", with i being a number + int i = 0; + size_t delim = tentativename.find_last_of('_'); + if (delim != std::string::npos && BaseToolkit::is_a_number(tentativename.substr(++delim), &i) ) + // keep same ending "_i" and increment i + tentativename = tentativename.substr(0, delim) + std::to_string(++i); + else + // add the "_i" ending + tentativename = basename + "_" + std::to_string( count ); + } else tentativename += "_"; diff --git a/UserInterfaceManager.cpp b/UserInterfaceManager.cpp index f53f124..f3da43d 100644 --- a/UserInterfaceManager.cpp +++ b/UserInterfaceManager.cpp @@ -5651,7 +5651,7 @@ void Navigator::RenderSourcePannel(Source *s) ImGui::PopFont(); // index indicator - ImGui::SetCursorPos(ImVec2(pannel_width_ - 35.f, 15.f)); + ImGui::SetCursorPos(ImVec2(pannel_width_ - 2 * ImGui::GetTextLineHeight(), 15.f)); ImGui::TextDisabled("#%d", Mixer::manager().indexCurrentSource()); // name