mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2025-03-14 13:20:59 +00:00
NOISSUE add back the MultiMC logo as the default instance icon
This commit is contained in:
parent
cfb716daa5
commit
c78adaccc8
@ -28,6 +28,7 @@
|
||||
IconList::IconList(const QStringList &builtinPaths, QString path, QObject *parent) : QAbstractListModel(parent)
|
||||
{
|
||||
QSet<QString> builtinNames;
|
||||
builtinNames.insert("logo");
|
||||
|
||||
// add builtin icons
|
||||
for(auto & builtinPath: builtinPaths)
|
||||
@ -39,7 +40,9 @@ IconList::IconList(const QStringList &builtinPaths, QString path, QObject *paren
|
||||
builtinNames.insert(file_info.baseName());
|
||||
}
|
||||
}
|
||||
for(auto & builtinName : builtinNames)
|
||||
QStringList builtinList = builtinNames.toList();
|
||||
builtinList.sort();
|
||||
for(auto & builtinName : builtinList)
|
||||
{
|
||||
addThemeIcon(builtinName);
|
||||
}
|
||||
@ -395,7 +398,7 @@ QIcon IconList::getIcon(const QString &key) const
|
||||
return icons[icon_index].icon();
|
||||
|
||||
// Fallback for icons that don't exist.
|
||||
icon_index = getIconIndex("grass");
|
||||
icon_index = getIconIndex("logo");
|
||||
|
||||
if (icon_index != -1)
|
||||
return icons[icon_index].icon();
|
||||
@ -404,7 +407,7 @@ QIcon IconList::getIcon(const QString &key) const
|
||||
|
||||
int IconList::getIconIndex(const QString &key) const
|
||||
{
|
||||
auto iter = name_index.find(key == "default" ? "grass" : key);
|
||||
auto iter = name_index.find(key == "default" ? "logo" : key);
|
||||
if (iter != name_index.end())
|
||||
return *iter;
|
||||
|
||||
|
@ -58,7 +58,13 @@ bool MMCIcon::has(IconType _type) const
|
||||
QIcon MMCIcon::icon() const
|
||||
{
|
||||
if (m_current_type == IconType::ToBeDeleted)
|
||||
{
|
||||
return QIcon();
|
||||
}
|
||||
if(m_current_type == IconType::Builtin && m_key == "logo")
|
||||
{
|
||||
return QIcon(":/logo.svg");
|
||||
}
|
||||
auto & icon = m_images[m_current_type].icon;
|
||||
if(!icon.isNull())
|
||||
return icon;
|
||||
|
@ -481,7 +481,7 @@ public:
|
||||
// NOTE: not added to toolbar, but used for instance context menu (right click)
|
||||
actionChangeInstIcon = TranslatedAction(MainWindow);
|
||||
actionChangeInstIcon->setObjectName(QStringLiteral("actionChangeInstIcon"));
|
||||
actionChangeInstIcon->setIcon(QIcon(":/icons/instances/grass"));
|
||||
actionChangeInstIcon->setIcon(QIcon(":/logo.svg"));
|
||||
actionChangeInstIcon->setIconVisibleInMenu(true);
|
||||
actionChangeInstIcon.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Change Icon"));
|
||||
actionChangeInstIcon.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Change the selected instance's icon."));
|
||||
@ -1985,7 +1985,7 @@ void MainWindow::selectionBad()
|
||||
statusBar()->clearMessage();
|
||||
ui->instanceToolBar->setEnabled(false);
|
||||
ui->renameButton->setText(tr("Rename Instance"));
|
||||
updateInstanceToolIcon("grass");
|
||||
updateInstanceToolIcon("logo");
|
||||
|
||||
// ...and then see if we can enable the previously selected instance
|
||||
setSelectedInstanceById(APPLICATION->settings()->get("SelectedInstance").toString());
|
||||
|
@ -43,7 +43,7 @@
|
||||
<widget class="QToolButton" name="iconButton">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/icons/instances/grass</normaloff>:/icons/instances/grass</iconset>
|
||||
<normaloff>:/logo.svg</normaloff>:/logo.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
|
Loading…
x
Reference in New Issue
Block a user