Skip to content

Commit a6aeb90

Browse files
committed
Add unchanging ID to tabs
fixes #14
1 parent 0734199 commit a6aeb90

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/GUI.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,12 @@ void GUI::Run() {
123123

124124
if (ImGui::BeginTabBar("##LayerSetTabs", ImGuiTabBarFlags_None)) {
125125
for (auto& layerSet: layerSets) {
126+
const auto name = layerSet.mStore->GetDisplayName();
126127
const auto label = layerSet.HasErrors()
127-
? fmt::format(
128-
"{} {}", Config::GLYPH_ERROR, layerSet.mStore->GetDisplayName())
129-
: layerSet.mStore->GetDisplayName();
130-
if (ImGui::BeginTabItem(label.c_str())) {
128+
? fmt::format("{} {}", Config::GLYPH_ERROR, name)
129+
: name;
130+
const auto labelWithID = fmt::format("{}###layerSet-{}", label, name);
131+
if (ImGui::BeginTabItem(labelWithID.c_str())) {
131132
layerSet.Draw();
132133
ImGui::EndTabItem();
133134
}

0 commit comments

Comments
 (0)