Skip to content

Commit 583f1b6

Browse files
committed
fix(component editor): Fix the GUI complexity UI layout
1 parent 9469e1b commit 583f1b6

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

ardupilot_methodic_configurator/frontend_tkinter_component_editor_base.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -166,27 +166,20 @@ def _create_intro_frame(self) -> None:
166166
intro_frame = ttk.Frame(self.main_frame)
167167
intro_frame.pack(side=tk.TOP, fill="x", expand=False)
168168

169-
self._add_explanation_text(intro_frame)
169+
# Add vehicle image first to the right side
170170
self._add_vehicle_image(intro_frame)
171171

172+
# Add explanation text to the left side
173+
self._add_explanation_text(intro_frame)
174+
172175
def _add_explanation_text(self, parent: ttk.Frame) -> None:
173176
"""Add explanation text to the parent frame."""
174-
explanation_text = _("Please configure properties of the vehicle components.\n")
175-
explanation_text += _("Labels for optional properties are displayed in gray text.\n")
176-
explanation_text += _("Scroll down to ensure that you do not overlook any properties.\n")
177-
178177
explanation_frame = ttk.Frame(parent)
179-
explanation_frame.pack(side=tk.TOP, fill=tk.X, padx=(10, 10), pady=(10, 0))
180-
181-
explanation_label = ttk.Label(
182-
explanation_frame, text=explanation_text, wraplength=WINDOW_WIDTH_PIX - VEHICLE_IMAGE_WIDTH_PIX, justify=tk.LEFT
183-
)
184-
explanation_label.configure(style="bigger.TLabel")
185-
explanation_label.pack(side=tk.LEFT, anchor=tk.NW)
178+
explanation_frame.pack(side=tk.LEFT, fill=tk.BOTH, expand=True, padx=(10, 10), pady=(10, 0))
186179

187180
# Add UI complexity combobox
188181
complexity_frame = ttk.Frame(explanation_frame)
189-
complexity_frame.pack(side=tk.RIGHT, anchor=tk.NE, padx=(0, 10))
182+
complexity_frame.pack(side=tk.TOP, anchor=tk.NW, padx=(0, 10))
190183

191184
complexity_label = ttk.Label(complexity_frame, text=_("GUI Complexity:"))
192185
complexity_label.pack(side=tk.LEFT, padx=(0, 5))
@@ -210,6 +203,16 @@ def _add_explanation_text(self, parent: ttk.Frame) -> None:
210203
),
211204
)
212205

206+
explanation_text = _("Please configure properties of the vehicle components.\n")
207+
explanation_text += _("Labels for optional properties are displayed in gray text.\n")
208+
explanation_text += _("Scroll down to ensure that you do not overlook any properties.\n")
209+
210+
explanation_label = ttk.Label(
211+
explanation_frame, text=explanation_text, wraplength=WINDOW_WIDTH_PIX - VEHICLE_IMAGE_WIDTH_PIX, justify=tk.LEFT
212+
)
213+
explanation_label.configure(style="bigger.TLabel")
214+
explanation_label.pack(side=tk.TOP, anchor=tk.NW, pady=self.calculate_scaled_padding_tuple(10, 0))
215+
213216
def _on_complexity_changed(self, _event: Optional[tk.Event] = None) -> None:
214217
"""Handle complexity combobox change."""
215218
old_gui_complexity = ProgramSettings.get_setting("gui_complexity")

0 commit comments

Comments
 (0)