|
34 | 34 | from MethodicConfigurator.frontend_tkinter_base import ProgressWindow
|
35 | 35 | from MethodicConfigurator.frontend_tkinter_base import BaseWindow
|
36 | 36 | from MethodicConfigurator.frontend_tkinter_base import RichText
|
| 37 | +from MethodicConfigurator.frontend_tkinter_base import get_font_family |
37 | 38 |
|
38 | 39 | from MethodicConfigurator.frontend_tkinter_directory_selection import VehicleDirectorySelectionWidgets
|
39 | 40 |
|
@@ -188,7 +189,7 @@ def __init__(self, current_file: str, flight_controller: FlightController,
|
188 | 189 |
|
189 | 190 | self.root.title("Amilcar Lucas's - ArduPilot methodic configurator " + version + \
|
190 | 191 | " - Parameter file editor and uploader")
|
191 |
| - self.root.geometry("900x500") # Set the window width |
| 192 | + self.root.geometry("990x550") # Set the window width |
192 | 193 |
|
193 | 194 | # Bind the close_connection_and_quit function to the window close event
|
194 | 195 | self.root.protocol("WM_DELETE_WINDOW", self.close_connection_and_quit)
|
@@ -241,11 +242,40 @@ def __create_conf_widgets(self, version: str):
|
241 | 242 | self.file_selection_combobox.bind("<<ComboboxSelected>>", self.on_param_file_combobox_change)
|
242 | 243 | self.file_selection_combobox.pack(side=tk.TOP, anchor=tk.NW, pady=(4, 0))
|
243 | 244 |
|
| 245 | + self.legend_frame(config_subframe, get_font_family(file_selection_label)) |
| 246 | + |
244 | 247 | image_label = BaseWindow.put_image_in_label(config_frame, LocalFilesystem.application_logo_filepath())
|
245 | 248 | image_label.pack(side=tk.RIGHT, anchor=tk.NE, padx=(4, 4), pady=(4, 0))
|
246 | 249 | image_label.bind("<Button-1>", lambda event: show_about_window(self.main_frame, version))
|
247 | 250 | show_tooltip(image_label, "User Manual, Support Forum, Report a Bug, Licenses, Source Code")
|
248 | 251 |
|
| 252 | + def legend_frame(self, config_subframe: ttk.Frame, font_family: str): |
| 253 | + style = ttk.Style() |
| 254 | + style.configure('Legend.TLabelframe', font=(font_family, 9)) |
| 255 | + legend_frame = ttk.LabelFrame(config_subframe, text="Legend", style='Legend.TLabelframe') |
| 256 | + legend_left = ttk.Frame(legend_frame) |
| 257 | + legend_left.pack(side=tk.LEFT, anchor=tk.NW) |
| 258 | + show_tooltip(legend_frame, "the meaning of the text background colors") |
| 259 | + |
| 260 | + font_size = 8 |
| 261 | + font = (font_family, font_size) |
| 262 | + np_label = ttk.Label(legend_left, text="Normal parameter", font=font) |
| 263 | + np_label.pack(side=tk.TOP, anchor=tk.NW) |
| 264 | + cal_label = ttk.Label(legend_left, text="Calibration param", background="yellow", font=font) |
| 265 | + cal_label.pack(side=tk.TOP, anchor=tk.NW) |
| 266 | + readonly_label = ttk.Label(legend_left, text="Read-only param", background="red", font=font) |
| 267 | + readonly_label.pack(side=tk.TOP, anchor=tk.NW) |
| 268 | + legend_right = ttk.Frame(legend_frame) |
| 269 | + legend_right.pack(side=tk.RIGHT, anchor=tk.NE) |
| 270 | + default_label = ttk.Label(legend_right, text="Default value", background="lightblue", font=font) |
| 271 | + default_label.pack(side=tk.TOP, anchor=tk.NW) |
| 272 | + na_label = ttk.Label(legend_right, text="Not available", background="orange", font=font) |
| 273 | + na_label.pack(side=tk.TOP, anchor=tk.NW) |
| 274 | + ne_label = ttk.Label(legend_right, text="Not editable", font=font) |
| 275 | + ne_label.configure(state='disabled') |
| 276 | + ne_label.pack(side=tk.TOP, anchor=tk.NW) |
| 277 | + legend_frame.pack(side=tk.LEFT, fill="x", expand=False, padx=(2, 2)) |
| 278 | + |
249 | 279 | def __create_parameter_area_widgets(self):
|
250 | 280 | self.show_only_differences = tk.BooleanVar(value=False)
|
251 | 281 | self.annotate_params_into_files = tk.BooleanVar(value=False)
|
|
0 commit comments