diff options
| author | Christian Kolset <christian.kolset@gmail.com> | 2026-06-03 10:12:34 -0600 |
|---|---|---|
| committer | Christian Kolset <christian.kolset@gmail.com> | 2026-06-03 10:12:34 -0600 |
| commit | 3610309b1e5d83049554afe287129c99389d231d (patch) | |
| tree | dcf2f554aff081381d6ff60074546a1a54732c96 /ui/main_window.py | |
| parent | 0a8d42501c1bf168bd852537bb3cd18490fac7ee (diff) | |
Fix settings/plugin window bugs; remove example plugin
- Add missing QGroupBox import to settings_window (caused silent crash on open)
- Remove Controls tab and _controls_tab() method from settings
- Clamp child window positions to screen bounds so they don't go off-screen on Windows when main window is maximized
- Apply same screen-clamp fix to Motion Capture plugin window
- Delete example plugin; disable it in enabled.json
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'ui/main_window.py')
| -rw-r--r-- | ui/main_window.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/ui/main_window.py b/ui/main_window.py index 4372b9f..abfd585 100644 --- a/ui/main_window.py +++ b/ui/main_window.py @@ -368,12 +368,25 @@ class MainWindow(QMainWindow): self._show_win(self._win_settings, "right") def _show_win(self, win: QWidget, position: str = "right"): - geo = self.geometry() if not win.isVisible(): + screen = QApplication.screenAt(self.geometry().center()) + if screen is None: + screen = QApplication.primaryScreen() + avail = screen.availableGeometry() + # Use normalGeometry so maximized windows don't push child off-screen + geo = self.normalGeometry() + win.adjustSize() + w, h = win.width(), win.height() if position == "right": - win.move(geo.right() + 8, geo.top() + 40) + x = geo.right() + 8 + y = geo.top() + 40 else: - win.move(geo.left(), geo.bottom() + 8) + x = geo.left() + y = geo.bottom() + 8 + # Clamp to available screen area + x = max(avail.left(), min(x, avail.right() - w)) + y = max(avail.top(), min(y, avail.bottom() - h)) + win.move(x, y) win.show(); win.raise_(); win.activateWindow() # ── Profile callbacks ───────────────────────────────────────────────── |
