Merge pull request #604 from flowln/fix_crash_with_gtk2

fix: crash with GTK2 theme due to QProxyStyle in ManagedPackPage
This commit is contained in:
Sefa Eyeoglu 2022-12-13 08:31:52 +01:00 committed by GitHub
commit 813663485d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,7 @@
#include <QListView>
#include <QProxyStyle>
#include <QStyleFactory>
#include <HoeDown.h>
@ -60,7 +61,10 @@ ManagedPackPage::ManagedPackPage(BaseInstance* inst, InstanceWindow* instance_wi
ui->setupUi(this);
ui->versionsComboBox->setStyle(new NoBigComboBoxStyle(ui->versionsComboBox->style()));
// NOTE: GTK2 themes crash with the proxy style.
// This seems like an upstream bug, so there's not much else that can be done.
if (!QStyleFactory::keys().contains("gtk2"))
ui->versionsComboBox->setStyle(new NoBigComboBoxStyle(ui->versionsComboBox->style()));
ui->reloadButton->setVisible(false);
connect(ui->reloadButton, &QPushButton::clicked, this, [this](bool){