GH-796 Icon theme loading workaround
Replacing the Qt machinery with other Qt machinery under our control
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
#include "logic/net/NetJob.h"
|
||||
#include "logic/java/JavaChecker.h"
|
||||
#include "BasePage.h"
|
||||
#include "MultiMC.h"
|
||||
|
||||
class JavaChecker;
|
||||
namespace Ui
|
||||
@ -41,7 +42,7 @@ public:
|
||||
}
|
||||
virtual QIcon icon() const override
|
||||
{
|
||||
return QIcon::fromTheme("instance-settings");
|
||||
return MMC->getThemedIcon("instance-settings");
|
||||
}
|
||||
virtual QString id() const override
|
||||
{
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include "logic/net/NetJob.h"
|
||||
#include "BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
|
||||
class ModList;
|
||||
class LegacyInstance;
|
||||
@ -41,7 +42,7 @@ public:
|
||||
}
|
||||
virtual QIcon icon() const
|
||||
{
|
||||
return QIcon::fromTheme("jarmods");
|
||||
return MMC->getThemedIcon("jarmods");
|
||||
}
|
||||
virtual QString id() const
|
||||
{
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "logic/OneSixInstance.h"
|
||||
#include "logic/net/NetJob.h"
|
||||
#include "BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
|
||||
class EnabledItemFilter;
|
||||
namespace Ui
|
||||
@ -40,7 +41,7 @@ public:
|
||||
}
|
||||
virtual QIcon icon() const override
|
||||
{
|
||||
return QIcon::fromTheme("checkupdate");
|
||||
return MMC->getThemedIcon("checkupdate");
|
||||
}
|
||||
virtual QString id() const override
|
||||
{
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "logic/net/NetJob.h"
|
||||
#include "logic/MinecraftProcess.h"
|
||||
#include "BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
|
||||
class EnabledItemFilter;
|
||||
class MinecraftProcess;
|
||||
@ -43,7 +44,7 @@ public:
|
||||
}
|
||||
virtual QIcon icon() const override
|
||||
{
|
||||
return QIcon::fromTheme("log");
|
||||
return MMC->getThemedIcon("log");
|
||||
}
|
||||
virtual QString id() const override
|
||||
{
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "logic/OneSixInstance.h"
|
||||
#include "logic/net/NetJob.h"
|
||||
#include "BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
|
||||
class EnabledItemFilter;
|
||||
class ModList;
|
||||
@ -43,7 +44,7 @@ public:
|
||||
}
|
||||
virtual QIcon icon() const override
|
||||
{
|
||||
return QIcon::fromTheme(m_iconName);
|
||||
return MMC->getThemedIcon(m_iconName);
|
||||
}
|
||||
virtual QString id() const override
|
||||
{
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "logic/BaseInstance.h"
|
||||
#include "logic/net/NetJob.h"
|
||||
#include "BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
|
||||
class EnabledItemFilter;
|
||||
namespace Ui
|
||||
@ -40,9 +41,9 @@ public:
|
||||
}
|
||||
virtual QIcon icon() const override
|
||||
{
|
||||
auto icon = QIcon::fromTheme("notes");
|
||||
auto icon = MMC->getThemedIcon("notes");
|
||||
if(icon.isNull())
|
||||
icon = QIcon::fromTheme("news");
|
||||
icon = MMC->getThemedIcon("news");
|
||||
return icon;
|
||||
}
|
||||
virtual QString id() const override
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <QWidget>
|
||||
|
||||
#include "BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
@ -46,7 +47,7 @@ public:
|
||||
}
|
||||
QIcon icon() const override
|
||||
{
|
||||
return QIcon::fromTheme("log");
|
||||
return MMC->getThemedIcon("log");
|
||||
}
|
||||
QString helpPage() const override
|
||||
{
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <QKeyEvent>
|
||||
|
||||
#include <pathutils.h>
|
||||
#include <MultiMC.h>
|
||||
|
||||
#include "gui/dialogs/ProgressDialog.h"
|
||||
#include "gui/dialogs/CustomMessageBox.h"
|
||||
@ -103,7 +104,7 @@ public:
|
||||
{
|
||||
m_thumbnailingPool.setMaxThreadCount(4);
|
||||
m_thumbnailCache = std::make_shared<SharedIconCache>();
|
||||
m_thumbnailCache->add("placeholder", QIcon::fromTheme("screenshot-placeholder"));
|
||||
m_thumbnailCache->add("placeholder", MMC->getThemedIcon("screenshot-placeholder"));
|
||||
connect(&watcher, SIGNAL(fileChanged(QString)), SLOT(fileChanged(QString)));
|
||||
// FIXME: the watched file set is not updated when files are removed
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include "logic/OneSixInstance.h"
|
||||
#include "BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
|
||||
class QFileSystemModel;
|
||||
class QIdentityProxyModel;
|
||||
@ -53,7 +54,7 @@ public:
|
||||
}
|
||||
virtual QIcon icon() const override
|
||||
{
|
||||
return QIcon::fromTheme("screenshots");
|
||||
return MMC->getThemedIcon("screenshots");
|
||||
}
|
||||
virtual QString id() const override
|
||||
{
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "gui/pages/BasePage.h"
|
||||
|
||||
#include "logic/auth/MojangAccountList.h"
|
||||
#include <MultiMC.h>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
@ -42,10 +43,10 @@ public:
|
||||
}
|
||||
QIcon icon() const override
|
||||
{
|
||||
auto icon = QIcon::fromTheme("accounts");
|
||||
auto icon = MMC->getThemedIcon("accounts");
|
||||
if(icon.isNull())
|
||||
{
|
||||
icon = QIcon::fromTheme("noaccount");
|
||||
icon = MMC->getThemedIcon("noaccount");
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <QWidget>
|
||||
|
||||
#include "gui/pages/BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
|
||||
namespace Ui {
|
||||
class ExternalToolsPage;
|
||||
@ -37,10 +38,10 @@ public:
|
||||
}
|
||||
QIcon icon() const override
|
||||
{
|
||||
auto icon = QIcon::fromTheme("externaltools");
|
||||
auto icon = MMC->getThemedIcon("externaltools");
|
||||
if(icon.isNull())
|
||||
{
|
||||
icon = QIcon::fromTheme("loadermods");
|
||||
icon = MMC->getThemedIcon("loadermods");
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "logic/java/JavaChecker.h"
|
||||
#include "gui/pages/BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
|
||||
class SettingsObject;
|
||||
|
||||
@ -42,7 +43,7 @@ public:
|
||||
}
|
||||
QIcon icon() const override
|
||||
{
|
||||
return QIcon::fromTheme("java");
|
||||
return MMC->getThemedIcon("java");
|
||||
}
|
||||
QString id() const override
|
||||
{
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "logic/java/JavaChecker.h"
|
||||
#include "gui/pages/BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
|
||||
class SettingsObject;
|
||||
|
||||
@ -42,7 +43,7 @@ public:
|
||||
}
|
||||
QIcon icon() const override
|
||||
{
|
||||
return QIcon::fromTheme("minecraft");
|
||||
return MMC->getThemedIcon("minecraft");
|
||||
}
|
||||
QString id() const override
|
||||
{
|
||||
|
@ -302,7 +302,7 @@ void MultiMCPage::applySettings()
|
||||
|
||||
if(original != s->get("IconTheme"))
|
||||
{
|
||||
QIcon::setThemeName(s->get("IconTheme").toString());
|
||||
MMC->setIconTheme(s->get("IconTheme").toString());
|
||||
}
|
||||
|
||||
// Console settings
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "logic/java/JavaChecker.h"
|
||||
#include "gui/pages/BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
|
||||
class QTextCharFormat;
|
||||
class SettingsObject;
|
||||
@ -43,7 +44,7 @@ public:
|
||||
}
|
||||
QIcon icon() const override
|
||||
{
|
||||
return QIcon::fromTheme("multimc");
|
||||
return MMC->getThemedIcon("multimc");
|
||||
}
|
||||
QString id() const override
|
||||
{
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "logic/java/JavaChecker.h"
|
||||
#include "gui/pages/BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
@ -40,7 +41,7 @@ public:
|
||||
}
|
||||
QIcon icon() const override
|
||||
{
|
||||
return QIcon::fromTheme("proxy");
|
||||
return MMC->getThemedIcon("proxy");
|
||||
}
|
||||
QString id() const override
|
||||
{
|
||||
|
Reference in New Issue
Block a user