Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ def _setup_application_icon(self) -> None:
# https://pythonassets.com/posts/window-icon-in-tk-tkinter/
try:
icon_path = ProgramSettings.application_icon_filepath()
self.root.iconphoto(True, tk.PhotoImage(file=icon_path)) # noqa: FBT003
self._icon_photo = tk.PhotoImage(master=self.root, file=icon_path)
self.root.iconphoto(True, self._icon_photo) # noqa: FBT003
except (tk.TclError, FileNotFoundError) as e:
# Silently ignore icon loading errors (common in test environments)
logging_error(_("Could not load application icon: %s"), e)
Comment thread
amilcarlucas marked this conversation as resolved.
Expand Down Expand Up @@ -524,7 +525,7 @@ def put_image_in_label( # pylint: disable=too-many-locals
buffer.seek(0)

# Create PhotoImage from buffer
photo = tk.PhotoImage(data=buffer.getvalue())
photo = tk.PhotoImage(master=parent, data=buffer.getvalue())

if is_debugging():
return ttk.Label(parent) # the vscode debugger can not cope with the images
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def create_option1_widgets( # pylint: disable=too-many-locals,too-many-argument
connected_fc_vehicle_type: str,
) -> None:
# Option 1 - Create a new vehicle configuration directory based on an existing template
option1_label = ttk.Label(text=_("New vehicle"), style="Bold.TLabel")
option1_label = ttk.Label(self.main_frame, text=_("New vehicle"), style="Bold.TLabel")
option1_label_frame = ttk.LabelFrame(self.main_frame, labelwidget=option1_label)
Comment thread
amilcarlucas marked this conversation as resolved.
option1_label_frame.pack(expand=True, fill=tk.X, padx=6, pady=6)
template_dir_edit_tooltip = _(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def close_and_quit(self) -> None:

def create_option1_widgets(self) -> None:
# Option 1 - Create a new vehicle configuration directory based on an existing template
option1_label = ttk.Label(text=_("New vehicle"), style="Bold.TLabel")
option1_label = ttk.Label(self.main_frame, text=_("New vehicle"), style="Bold.TLabel")
option1_label_frame = ttk.LabelFrame(self.main_frame, labelwidget=option1_label)
Comment thread
amilcarlucas marked this conversation as resolved.
option1_label_frame.pack(expand=True, fill=tk.X, padx=6, pady=6)

Expand Down Expand Up @@ -112,7 +112,7 @@ def on_bin_log_selected(bin_file: str) -> None:

def create_option2_widgets(self, initial_dir: str) -> None:
# Option 2 - Use an existing vehicle configuration directory
option2_label = ttk.Label(text=_("Open vehicle"), style="Bold.TLabel")
option2_label = ttk.Label(self.main_frame, text=_("Open vehicle"), style="Bold.TLabel")
option2_label_frame = ttk.LabelFrame(self.main_frame, labelwidget=option2_label)
option2_label_frame.pack(expand=True, fill=tk.X, padx=6, pady=6)
option2_label = ttk.Label(
Expand Down Expand Up @@ -140,7 +140,7 @@ def on_vehicle_directory_selected(directory: str) -> None:

def create_option3_widgets(self) -> None:
# Option 3 - Open the last used vehicle configuration directory
option3_label = ttk.Label(text=_("Re-Open vehicle"), style="Bold.TLabel")
option3_label = ttk.Label(self.main_frame, text=_("Re-Open vehicle"), style="Bold.TLabel")
option3_label_frame = ttk.LabelFrame(self.main_frame, labelwidget=option3_label)
option3_label_frame.pack(expand=True, fill=tk.X, padx=6, pady=6)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_frontend_tkinter_base_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def test_user_sees_properly_sized_images(self, image_test_context, sample_image_
mocks["open_mock"].assert_called_once_with(sample_image_file)
mocks["image"].resize.assert_called_once()
# Check that PhotoImage was called with data parameter (our new implementation)
mocks["photo_mock"].assert_called_once_with(data=b"fake_png_data")
mocks["photo_mock"].assert_called_once_with(master=parent_frame, data=b"fake_png_data")

def test_user_sees_fallback_when_image_unavailable(self, image_test_context, mocked_base_window) -> None:
"""
Expand Down
Loading