App window now tries to fit the screen

This commit is contained in:
Deniz Şafak
2025-07-16 06:26:59 +03:00
parent d16c7603ce
commit 8bc51dd270
2 changed files with 8 additions and 4 deletions
+5 -2
View File
@@ -763,7 +763,11 @@ class abogen(QWidget):
self.setWindowTitle(f"{PROGRAM_NAME} v{VERSION}")
screen = QApplication.primaryScreen().geometry()
width, height = 500, 800
x, y = (screen.width() - width) // 2, (screen.height() - height) // 2
x = (screen.width() - width) // 2
# If desired height is larger than screen, fit to screen height
if height > screen.height() - 65:
height = screen.height() - 100 # Leave a margin for window borders
y = max((screen.height() - height) // 2, 0)
self.setGeometry(x, y, width, height)
outer_layout = QVBoxLayout()
outer_layout.setContentsMargins(15, 15, 15, 15)
@@ -2871,7 +2875,6 @@ class abogen(QWidget):
)
if reply == QMessageBox.Yes:
from abogen.utils import get_user_config_path
import sys
config_path = get_user_config_path()
try: