aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-01-07 23:04:56 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-01-28 10:15:59 +0100
commit6dc58e99457fe4609fa3c401e89f98c92dbd9878 (patch)
tree359990bae31856cb3159fca7fc4b92b7ed878597
parente2ebc8567a96e92d1c039b2e7c5f48826fece810 (diff)
downloadbitcoin-6dc58e99457fe4609fa3c401e89f98c92dbd9878.tar.xz
qt: Use "fusion" style on macOS Big Sur with old Qt
The "macintosh" style is broken on macOS Big Sur at least for Qt 5.9.8. Github-Pull: #bitcoin-core/gui#177 Rebased-From: 4e1154dfd128cbada65e9ea08ee274cdeafc4c53
-rw-r--r--src/qt/bitcoin.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index 63b4107f7e..6737452aba 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -51,6 +51,7 @@
#include <QThread>
#include <QTimer>
#include <QTranslator>
+#include <QtGlobal>
#if defined(QT_STATICPLUGIN)
#include <QtPlugin>
@@ -466,6 +467,13 @@ int GuiMain(int argc, char* argv[])
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
+#if (QT_VERSION <= QT_VERSION_CHECK(5, 9, 8)) && defined(Q_OS_MACOS)
+ const auto os_name = QSysInfo::prettyProductName();
+ if (os_name.startsWith("macOS 11") || os_name.startsWith("macOS 10.16")) {
+ QApplication::setStyle("fusion");
+ }
+#endif
+
BitcoinApplication app;
/// 2. Parse command-line options. We do this after qt in order to show an error if there are problems parsing these