Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that when the layout item is changed the layout sub item also gets reset to first item, else KeyError is thrown #974

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading