Skip to content

Commit

Permalink
[bug 973] gnome-terminator#973 - ensure that when the layout item is …
Browse files Browse the repository at this point in the history
…changed the layout sub item also gets reset to first item, else KeyError is thrown as described in bug
  • Loading branch information
vssdeo committed Dec 14, 2024
1 parent fa89055 commit 3b07d9b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions terminatorlib/prefseditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2115,6 +2115,12 @@ def update_profiles(self):

def on_layout_selection_changed(self, selection):
"""A different layout was selected"""
#reset the layout item to first item when a diff
#layout is selected and highlight
if self.treestore.get_iter_first():
path = Gtk.TreePath.new_from_indices([0])
self.treeview.set_cursor(path, None, False)

(listmodel, rowiter) = selection.get_selected()
if not rowiter:
# Something is wrong, just jump to the first item in the list
Expand All @@ -2136,6 +2142,7 @@ def on_layout_selection_changed(self, selection):
command.set_sensitive(False)
chooser.set_sensitive(False)
workdir.set_sensitive(False)
self.treeview.grab_focus()

def on_layout_item_selection_changed(self, selection):
"""A different item in the layout was selected"""
Expand Down

0 comments on commit 3b07d9b

Please sign in to comment.