Skip to content

Commit 3dcd317

Browse files
committed
fix(gui): parent project section labels to main frame
Prevent Tk labelwidget parent mismatches in project opener/creator windows by creating section labels with self.main_frame as parent.
1 parent 055c723 commit 3dcd317

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

ardupilot_methodic_configurator/frontend_tkinter_project_creator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def create_option1_widgets( # pylint: disable=too-many-locals,too-many-argument
9292
connected_fc_vehicle_type: str,
9393
) -> None:
9494
# Option 1 - Create a new vehicle configuration directory based on an existing template
95-
option1_label = ttk.Label(text=_("New vehicle"), style="Bold.TLabel")
95+
option1_label = ttk.Label(self.main_frame, text=_("New vehicle"), style="Bold.TLabel")
9696
option1_label_frame = ttk.LabelFrame(self.main_frame, labelwidget=option1_label)
9797
option1_label_frame.pack(expand=True, fill=tk.X, padx=6, pady=6)
9898
template_dir_edit_tooltip = _(

ardupilot_methodic_configurator/frontend_tkinter_project_opener.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def close_and_quit(self) -> None:
8282

8383
def create_option1_widgets(self) -> None:
8484
# Option 1 - Create a new vehicle configuration directory based on an existing template
85-
option1_label = ttk.Label(text=_("New vehicle"), style="Bold.TLabel")
85+
option1_label = ttk.Label(self.main_frame, text=_("New vehicle"), style="Bold.TLabel")
8686
option1_label_frame = ttk.LabelFrame(self.main_frame, labelwidget=option1_label)
8787
option1_label_frame.pack(expand=True, fill=tk.X, padx=6, pady=6)
8888

@@ -112,7 +112,7 @@ def on_bin_log_selected(bin_file: str) -> None:
112112

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

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

0 commit comments

Comments
 (0)