Skip to content

Commit e415974

Browse files
committed
Fix "Reset all to default" context menu containing duplicated items when category is made current multiple times
1 parent bcbc09c commit e415974

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

source/runtime_gui.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3530,7 +3530,10 @@ void reshade::runtime::draw_variable_editor()
35303530
{
35313531
for (float x = 0, space_x = ImGui::CalcTextSize(" ").x, width = (ImGui::CalcItemWidth() - ImGui::CalcTextSize(category_label.data()).x - 45) / 2; x < width; x += space_x)
35323532
category_label.insert(0, " ");
3533-
category_label += "###" + current_category; // Ensure widget ID does not change with varying width
3533+
// Ensure widget ID does not change with varying width
3534+
category_label += "###" + current_category;
3535+
// Append a unique value so that the context menu does not contain duplicated widgets when a category is made current multiple times
3536+
category_label += std::to_string(variable_index);
35343537
}
35353538

35363539
if (category_visible = true;

0 commit comments

Comments
 (0)