Skip to content

Commit a4728d1

Browse files
committed
BUGFIX: proper resize of FC info window
1 parent 3ac4e2e commit a4728d1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

MethodicConfigurator/frontend_tkinter_flightcontroller_info.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ def __init__(self, flight_controller: FlightController):
3636

3737
# Create a frame to hold all the labels and text fields
3838
self.info_frame = ttk.Frame(self.main_frame)
39-
self.info_frame.pack(padx=20, pady=20)
39+
self.info_frame.pack(fill=tk.BOTH, padx=20, pady=20)
4040

4141
# Dynamically create labels and text fields for each attribute
4242
for row_nr, (description, attr_value) in enumerate(flight_controller.info.get_info().items()):
4343
label = ttk.Label(self.info_frame, text=f"{description}:")
4444
label.grid(row=row_nr, column=0, sticky="w")
4545

46-
text_field = ttk.Entry(self.info_frame, width=60)
47-
text_field.grid(row=row_nr, column=1, sticky="w")
46+
text_field = ttk.Entry(self.info_frame)
47+
text_field.grid(row=row_nr, column=1, sticky="ew", columnspan=1)
4848

4949
# Check if the attribute exists and has a non-empty value before inserting
5050
if attr_value:
@@ -56,6 +56,8 @@ def __init__(self, flight_controller: FlightController):
5656
text_field.insert(tk.END, "N/A") # Insert "Not Available" if the attribute is missing or empty
5757
text_field.configure(state="readonly")
5858

59+
self.info_frame.columnconfigure(1, weight=1)
60+
5961
logging_info("Firmware Version: %s", flight_controller.info.flight_sw_version_and_type)
6062
logging_info(f"Firmware first 8 hex bytes of the FC git hash: {flight_controller.info.flight_custom_version}")
6163
logging_info(f"Firmware first 8 hex bytes of the ChibiOS git hash: {flight_controller.info.os_custom_version}")

0 commit comments

Comments
 (0)