Skip to content

Commit

Permalink
UI: Fix sidebars with same name being unclickable
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Dec 23, 2023
1 parent 6245d3e commit 8c54fcf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ void Framework::draw_ui() {
ImGui::TableSetColumnIndex(0); // Set to the first column

ImGui::BeginChild("UEVRLeftPane", ImVec2(0, 0), true);
auto dcs = [&](const char* label, uint32_t page_value) -> bool {
auto dcs = [&](const char* label, int32_t page_value) -> bool {
ImGui::PushStyleVar(ImGuiStyleVar_SelectableTextAlign, ImVec2(0.5f, 0.5f));
if (ImGui::Selectable(label, m_sidebar_state.selected_entry == page_value)) {
m_sidebar_state.selected_entry = page_value;
Expand Down Expand Up @@ -1277,7 +1277,9 @@ void Framework::draw_ui() {
}
}

ImGui::PushID(i);
dcs(sidebar_entries[i].m_label.c_str(), i);
ImGui::PopID();
}
}

Expand Down

0 comments on commit 8c54fcf

Please sign in to comment.