Add handler for entry highlighting in the left pane

This commit is contained in:
Philip Henning 2025-07-29 15:09:54 +02:00
parent b8e4b29f04
commit 69ee221a63

View file

@ -226,6 +226,12 @@ class HostsManagerApp(App):
self.selected_entry_index = event.list_view.index or 0 self.selected_entry_index = event.list_view.index or 0
self.update_entry_details() self.update_entry_details()
def on_list_view_highlighted(self, event: ListView.Highlighted) -> None:
"""Handle entry highlighting (cursor movement) in the left pane."""
if event.list_view.id == "entries-list":
self.selected_entry_index = event.list_view.index or 0
self.update_entry_details()
def action_reload(self) -> None: def action_reload(self) -> None:
"""Reload the hosts file.""" """Reload the hosts file."""
self.load_hosts_file() self.load_hosts_file()