From fb9d6ebee61ebd2c40b9fbebffa9bf7f86d22e8d Mon Sep 17 00:00:00 2001 From: lm Date: Sun, 19 Oct 2025 19:59:18 +0200 Subject: [PATCH] Open maximized and refine toolbar layout --- app/qt/app.py | 2 +- app/qt/main_window.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/qt/app.py b/app/qt/app.py index df14acf..b5dd42d 100644 --- a/app/qt/app.py +++ b/app/qt/app.py @@ -51,5 +51,5 @@ def run() -> int: defaults=DEFAULTS.copy(), reset_exclusions=RESET_EXCLUSIONS_ON_IMAGE_CHANGE, ) - window.show() + window.showMaximized() return app.exec() diff --git a/app/qt/main_window.py b/app/qt/main_window.py index 44cc455..b7c1547 100644 --- a/app/qt/main_window.py +++ b/app/qt/main_window.py @@ -68,9 +68,13 @@ class ToolbarButton(QtWidgets.QPushButton): """Rounded toolbar button inspired by the legacy design.""" def __init__(self, icon_text: str, label: str, callback: Callable[[], None], parent: QtWidgets.QWidget | None = None): - super().__init__(f"{icon_text} {label}", parent) + text = f"{icon_text} {label}" + super().__init__(text, parent) self.setCursor(QtCore.Qt.PointingHandCursor) - self.setFixedHeight(34) + self.setFixedHeight(32) + metrics = QtGui.QFontMetrics(self.font()) + width = metrics.horizontalAdvance(text) + 28 + self.setMinimumWidth(width) self.setStyleSheet( """ QPushButton {