Skip to content

Commit 9c434dc

Browse files
fix: grammar nit and copilot suggestions
Signed-off-by: Omkar Sarkar <omkarsarkar24@gmail.com>
1 parent f6081db commit 9c434dc

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

ardupilot_methodic_configurator/frontend_tkinter_progress_window.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def __init__( # pylint: disable=too-many-arguments, too-many-positional-argumen
4242
self.progress_window = tk.Toplevel(self.parent)
4343
# Withdraw immediately to prevent flicker while setting up
4444
self.progress_window.withdraw()
45+
self._is_aqua = self.progress_window.tk.call("tk", "windowingsystem") == "aqua"
4546
self.progress_window.title(title)
4647
try:
4748
dpi = self.progress_window.winfo_fpixels("1i")
@@ -121,7 +122,8 @@ def update_progress_bar(self, current_value: int, max_value: int) -> None:
121122
self.progress_window.deiconify()
122123
self._center_progress_window()
123124
self.progress_window.lift()
124-
self.progress_window.update() # Paint pixels now
125+
if getattr(self, "_is_aqua", False):
126+
self.progress_window.update() # macOS needs this to paint pixels NOW
125127
self._shown = True
126128
elif not self.only_show_when_update_progress_called:
127129
self.progress_window.lift()
@@ -145,7 +147,7 @@ def update_progress_bar(self, current_value: int, max_value: int) -> None:
145147
# other windows while a blocking upload/download is in flight.
146148
self.progress_bar.update_idletasks()
147149

148-
if self.progress_window.tk.call("tk", "windowingsystem") == "aqua":
150+
if getattr(self, "_is_aqua", False):
149151
self.progress_window.update()
150152

151153
# Close the progress window when the process is complete

ardupilot_methodic_configurator/frontend_tkinter_show.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ def __init__( # pylint: disable=too-many-arguments, too-many-positional-argumen
481481
if tag_name and isinstance(self.widget, tk.Text):
482482
self.widget.tag_bind(tag_name, "<Enter>", self.schedule_show, "+")
483483
self.widget.tag_bind(tag_name, "<Leave>", self.destroy_hide, "+")
484+
self.widget.tag_bind(tag_name, "<ButtonPress>", self.destroy_hide, "+")
484485
else:
485486
self.widget.bind("<Enter>", self.schedule_show, "+")
486487
self.widget.bind("<Leave>", self.destroy_hide, "+")
@@ -537,7 +538,7 @@ def create_show(self, _event: Optional[tk.Event] = None) -> None:
537538

538539
self.tooltip = cast("tk.Toplevel", self.toplevel_class(self.widget, bg="#ffffe0"))
539540

540-
# Remove the windows buttons on all OSs
541+
# Remove the window buttons on all OSs
541542
self.tooltip.wm_overrideredirect(True) # noqa: FBT003
542543

543544
if not self._is_aqua:

0 commit comments

Comments
 (0)