mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Improve Source naming increment
This commit is contained in:
@@ -55,8 +55,17 @@ std::string BaseToolkit::uniqueName(const std::string &basename, std::list<std::
|
||||
++count;
|
||||
}
|
||||
|
||||
if (count > 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 += "_";
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user