From 272d53079f36b0235b87eaf60508f71240cd1e9b Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 28 Dec 2022 11:54:32 +1000 Subject: [PATCH] Pad buttons instead of using min-width Qt seems to be treating min-width more like width, and truncates text. The issue is not limited to macOS with force_custom_styles: with a sufficiently large amount of text on a button, it truncates on other platforms too. https://forums.ankiweb.net/t/2-1-55-issue-with-auto-browser-and-upload-download-dialog/25636 There are a few other uses of min-width in the styling - it may be worth checking whether they suffer from the same issue as well. --- qt/aqt/stylesheets.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qt/aqt/stylesheets.py b/qt/aqt/stylesheets.py index 4058f6479..e67f518c7 100644 --- a/qt/aqt/stylesheets.py +++ b/qt/aqt/stylesheets.py @@ -1,5 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + from aqt import colors, props from aqt.theme import ThemeManager @@ -101,9 +102,7 @@ QMenu::indicator {{ def button_styles(tm: ThemeManager) -> str: return f""" -QPushButton {{ - min-width: 75px; -}} +QPushButton {{ padding-left: 15px; padding-right: 15px; }} QPushButton, QTabBar::tab:!selected, QComboBox:!editable,