Skip to content

Commit

Permalink
FIX: Do not scroll to the top when deleting parameters
Browse files Browse the repository at this point in the history
fixes #50
  • Loading branch information
amilcarlucas committed Oct 30, 2024
1 parent 379ade2 commit b12373e
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,17 @@ def __create_change_reason_entry(self, param_name, param, new_value_entry):

def __on_parameter_delete(self, param_name):
if messagebox.askyesno(f"{self.current_file}", _(f"Are you sure you want to delete the {param_name} parameter?")):
# Capture current vertical scroll position
current_scroll_position = self.canvas.yview()[0]

# Delete the parameter
del self.local_filesystem.file_parameters[self.current_file][param_name]
self.at_least_one_param_edited = True
self.parameter_editor.repopulate_parameter_table(self.current_file)

# Restore the scroll position
self.canvas.yview_moveto(current_scroll_position)

def __on_parameter_add(self, fc_parameters):
add_parameter_window = BaseWindow(self.root)
add_parameter_window.root.title(_("Add Parameter to ") + self.current_file)
Expand Down

0 comments on commit b12373e

Please sign in to comment.