Skip to content

Commit 02c0701

Browse files
committed
fix(window size): On KDE linux systems
1 parent 71523eb commit 02c0701

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

ardupilot_methodic_configurator/frontend_tkinter_parameter_editor.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ def __init__(self, configuration_manager: ConfigurationManager) -> None:
202202

203203
self.__create_parameter_area_widgets()
204204

205+
# Resize window height to ensure all widgets, including the skip button, are fully visible
206+
# as some Linux Window managers like KDE, like to change font sizes and padding.
207+
# So we need to dynamically accommodate for that after placing the widgets
208+
self.root.update_idletasks()
209+
req_height = self.root.winfo_reqheight()
210+
self.root.geometry(f"990x{req_height}")
205211
# trigger a table update to ask the user what to do in the case this file needs special actions
206212
self.root.after(10, lambda: self.on_param_file_combobox_change(None, forced=True))
207213

ardupilot_methodic_configurator/frontend_tkinter_usage_popup_window.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def setup_window(
5252
"""Set up the basic window properties and add the instructions text."""
5353
popup_window.root.title(title)
5454
popup_window.root.geometry(geometry)
55-
instructions_text.config(borderwidth=0, relief="flat")
55+
instructions_text.config(borderwidth=0, relief="flat", highlightthickness=0)
5656
instructions_text.pack(padx=6, pady=10)
5757

5858
@staticmethod
@@ -79,6 +79,14 @@ def update_show_again() -> None:
7979
@staticmethod
8080
def finalize_window_setup(popup_window: BaseWindow, parent: tk.Tk, close_callback: Callable[[], None]) -> None:
8181
"""Finalize window setup: center, make topmost, disable parent, set close handler."""
82+
# Resize window height to ensure all widgets are fully visible
83+
# as some Linux Window managers like KDE, like to change font sizes and padding.
84+
# So we need to dynamically accommodate for that after placing the widgets
85+
popup_window.root.update_idletasks()
86+
req_height = popup_window.root.winfo_reqheight()
87+
req_width = popup_window.root.winfo_reqwidth()
88+
popup_window.root.geometry(f"{req_width}x{req_height}")
89+
8290
BaseWindow.center_window(popup_window.root, parent)
8391
popup_window.root.deiconify() # Show the window now that it's positioned
8492
popup_window.root.attributes("-topmost", True) # noqa: FBT003

0 commit comments

Comments
 (0)