pygui: cleaned up toolbar picker code, fixed closing app when a picker is showing

This commit is contained in:
Blake Harnden 2020-05-16 01:14:48 -07:00
parent 29fc5acb99
commit 50816b3b80
2 changed files with 71 additions and 112 deletions

View file

@ -149,6 +149,8 @@ class Application(ttk.Frame):
self.after(0, lambda: ErrorDialog(self, title, message).show())
def on_closing(self) -> None:
if self.toolbar.picker:
self.toolbar.picker.destroy()
self.menubar.prompt_save_running_session(True)
def save_config(self) -> None:
@ -163,5 +165,8 @@ class Application(ttk.Frame):
def get_icon(self, image_enum: ImageEnum, width: int) -> PhotoImage:
return Images.get(image_enum, int(width * self.app_scale))
def get_custom_icon(self, image_file: str, width: int) -> PhotoImage:
return Images.get_custom(image_file, int(width * self.app_scale))
def close(self) -> None:
self.master.destroy()