From 309c46740379795df0d7246965b865f44b92c099 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 5 Jan 2023 17:15:10 +1000 Subject: [PATCH] Work around button margins being too thin on Windows --- qt/aqt/stylesheets.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qt/aqt/stylesheets.py b/qt/aqt/stylesheets.py index e67f518c7..1087524c0 100644 --- a/qt/aqt/stylesheets.py +++ b/qt/aqt/stylesheets.py @@ -1,6 +1,7 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html +from anki.utils import is_win from aqt import colors, props from aqt.theme import ThemeManager @@ -101,8 +102,10 @@ QMenu::indicator {{ def button_styles(tm: ThemeManager) -> str: + # For some reason, Windows needs a larger padding to look the same + button_pad = 25 if is_win else 15 return f""" -QPushButton {{ padding-left: 15px; padding-right: 15px; }} +QPushButton {{ padding-left: {button_pad}px; padding-right: {button_pad}px; }} QPushButton, QTabBar::tab:!selected, QComboBox:!editable,