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.
This commit is contained in:
Damien Elmes 2022-12-28 11:54:32 +10:00
parent b415c7a9a5
commit 272d53079f

View file

@ -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,