Skip to content

fix(window size): On KDE linux systems#1011

Merged
amilcarlucas merged 2 commits into
masterfrom
fix_1010
Nov 3, 2025
Merged

fix(window size): On KDE linux systems#1011
amilcarlucas merged 2 commits into
masterfrom
fix_1010

Conversation

@amilcarlucas

Copy link
Copy Markdown
Collaborator

Fixes #1010

@neo-0007 can you please test this fix on your linux KDE system?

Copilot AI review requested due to automatic review settings November 2, 2025 20:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes window sizing issues on Linux window managers (particularly KDE) that modify font sizes and padding. The changes implement dynamic window height calculation to ensure all widgets remain fully visible.

  • Removed hardcoded window geometry to allow dynamic sizing based on content
  • Added dynamic height calculation after widget placement using winfo_reqheight()
  • Fixed a potential issue with the usage popup window callback by wrapping it in a lambda and adding existence check

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
frontend_tkinter_usage_popup_window.py Added dynamic height resizing logic to popup windows to accommodate varying font sizes and padding
frontend_tkinter_parameter_editor.py Removed hardcoded window height, added dynamic height calculation, reordered startup notification, and fixed usage popup callback


# Set up startup notification for the main application window
FreeDesktop.setup_startup_notification(self.root) # type: ignore[arg-type]
if isinstance(self.root, tk.Tk) and UsagePopupWindow.should_display("parameter_editor"):

Copilot AI Nov 2, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The isinstance(self.root, tk.Tk) check is unnecessary. According to the BaseWindow class definition, self.root is typed as Union[tk.Toplevel, tk.Tk], but ParameterEditorWindow inherits from BaseWindow and creates the main application window (no parent passed to __init__), so self.root will always be tk.Tk. This check adds unnecessary complexity.

Suggested change
if isinstance(self.root, tk.Tk) and UsagePopupWindow.should_display("parameter_editor"):
if UsagePopupWindow.should_display("parameter_editor"):

Copilot uses AI. Check for mistakes.
@github-actions

github-actions Bot commented Nov 2, 2025

Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
8906 7469 84% 80% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
ardupilot_methodic_configurator/frontend_tkinter_parameter_editor.py 73% 🟢
ardupilot_methodic_configurator/frontend_tkinter_usage_popup_window.py 92% 🟢
TOTAL 82% 🟢

updated for commit: 06952e9 by action🐍

@github-actions

github-actions Bot commented Nov 2, 2025

Copy link
Copy Markdown
Contributor

Test Results

    3 files      3 suites   2m 55s ⏱️
2 008 tests 2 006 ✅ 2 💤 0 ❌
6 024 runs  6 018 ✅ 6 💤 0 ❌

Results for commit 06952e9.

♻️ This comment has been updated with latest results.

@neo-0007

neo-0007 commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

The parameter editor is working as intended , but the popup window is acting strangely :
strange_popup

But on maximizing the popup window its working.

@amilcarlucas amilcarlucas force-pushed the fix_1010 branch 2 times, most recently from 7094e89 to 47f4b12 Compare November 3, 2025 17:26
@amilcarlucas

Copy link
Copy Markdown
Collaborator Author

@neo-0007 please re-try it again

@neo-0007

neo-0007 commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

@amilcarlucas It works fine now , Thanks !

@amilcarlucas amilcarlucas merged commit 414b46e into master Nov 3, 2025
30 checks passed
@amilcarlucas amilcarlucas deleted the fix_1010 branch November 3, 2025 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bottom buttons not visible without maximizing window on Ubuntu 24

3 participants