Prevent suggestions from showing after route is plotted

This commit is contained in:
CMDR-Kiel42 2020-07-18 21:47:03 +02:00
parent d4bd41155d
commit face54fc95
2 changed files with 6 additions and 2 deletions

View File

@ -39,10 +39,10 @@ class AutoCompleter(PlaceHolder):
self.update_me()
def ac_foc_out(self, event):
def ac_foc_out(self, event=None):
x,y = self.parent.winfo_pointerxy()
widget_under_cursor = self.parent.winfo_containing(x,y)
if widget_under_cursor != self.lb and widget_under_cursor != self:
if (widget_under_cursor != self.lb and widget_under_cursor != self) or event is None:
self.foc_out()
self.hide_list()

View File

@ -362,6 +362,10 @@ class SpanshRouter():
dest = self.dest_ac.get().strip()
efficiency = self.efficiency_slider.get()
# Hide autocomplete lists in case they're still shown
self.source_ac.ac_foc_out()
self.dest_ac.ac_foc_out()
if ( source and source != self.source_ac.placeholder and
dest and dest != self.dest_ac.placeholder ):