Skip to content

Commit

Permalink
index = self.variables_layout.count() - 1
Browse files Browse the repository at this point in the history
  • Loading branch information
dertwist committed Dec 24, 2024
1 parent 45d4ef0 commit d2b2704
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def add_variable(self, name, var_class, var_value, var_visible_in_editor, var_di
)
variable.duplicate.connect(self.duplicate_variable)
if index is None:
index = self.variables_layout.count()
index = self.variables_layout.count() - 1
else:
index += 1 # Insert after current index when duplicating
self.variables_layout.insertWidget(index, variable)
Expand Down

0 comments on commit d2b2704

Please sign in to comment.