diff options
Diffstat (limited to 'api/gui')
-rw-r--r-- | api/gui/CMakeLists.txt | 7 | ||||
-rw-r--r-- | api/gui/SkinUtils.cpp | 2 | ||||
-rw-r--r-- | api/gui/SkinUtils.h | 2 | ||||
-rw-r--r-- | api/gui/icons/IconList.cpp | 25 | ||||
-rw-r--r-- | api/gui/icons/IconList.h | 4 | ||||
-rw-r--r-- | api/gui/icons/MMCIcon.cpp | 2 | ||||
-rw-r--r-- | api/gui/icons/MMCIcon.h | 2 |
7 files changed, 21 insertions, 23 deletions
diff --git a/api/gui/CMakeLists.txt b/api/gui/CMakeLists.txt index 911a0ab8..deae735f 100644 --- a/api/gui/CMakeLists.txt +++ b/api/gui/CMakeLists.txt @@ -26,3 +26,10 @@ qt5_use_modules(MultiMC_gui Gui) # Mark and export headers target_include_directories(MultiMC_gui PUBLIC "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}") + +# Install it +install( + TARGETS MultiMC_gui + RUNTIME DESTINATION ${LIBRARY_DEST_DIR} + LIBRARY DESTINATION ${LIBRARY_DEST_DIR} +)
\ No newline at end of file diff --git a/api/gui/SkinUtils.cpp b/api/gui/SkinUtils.cpp index 66708236..3950cbc0 100644 --- a/api/gui/SkinUtils.cpp +++ b/api/gui/SkinUtils.cpp @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 MultiMC Contributors +/* Copyright 2013-2018 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/api/gui/SkinUtils.h b/api/gui/SkinUtils.h index eeaa6c12..f042b908 100644 --- a/api/gui/SkinUtils.h +++ b/api/gui/SkinUtils.h @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 MultiMC Contributors +/* Copyright 2013-2018 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/api/gui/icons/IconList.cpp b/api/gui/icons/IconList.cpp index 3da0a8ea..5c2c1386 100644 --- a/api/gui/icons/IconList.cpp +++ b/api/gui/icons/IconList.cpp @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 MultiMC Contributors +/* Copyright 2013-2018 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -261,7 +261,7 @@ void IconList::installIcons(const QStringList &iconFiles) QString target = FS::PathCombine(m_dir.dirName(), fileinfo.fileName()); QString suffix = fileinfo.suffix(); - if (suffix != "jpeg" && suffix != "png" && suffix != "jpg" && suffix != "ico") + if (suffix != "jpeg" && suffix != "png" && suffix != "jpg" && suffix != "ico" && suffix != "svg") continue; if (!QFile::copy(file, target)) @@ -331,7 +331,7 @@ bool IconList::addIcon(const QString &key, const QString &name, const QString &p { // replace the icon even? is the input valid? QIcon icon(path); - if (!icon.availableSizes().size()) + if (icon.isNull()) return false; auto iter = name_index.find(key); if (iter != name_index.end()) @@ -392,20 +392,6 @@ QIcon IconList::getIcon(const QString &key) const return QIcon(); } -QIcon IconList::getBigIcon(const QString &key) const -{ - int icon_index = getIconIndex(key); - - // Fallback for icons that don't exist. - icon_index = getIconIndex(icon_index == -1 ? "infinity" : key); - - if (icon_index == -1) - return QIcon(); - - QPixmap bigone = icons[icon_index].icon().pixmap(256,256).scaled(256,256); - return QIcon(bigone); -} - int IconList::getIconIndex(const QString &key) const { auto iter = name_index.find(key == "default" ? "infinity" : key); @@ -415,4 +401,9 @@ int IconList::getIconIndex(const QString &key) const return -1; } +QString IconList::getDirectory() const +{ + return m_dir.absolutePath(); +} + //#include "IconList.moc" diff --git a/api/gui/icons/IconList.h b/api/gui/icons/IconList.h index 6a6e8b5c..b8599103 100644 --- a/api/gui/icons/IconList.h +++ b/api/gui/icons/IconList.h @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 MultiMC Contributors +/* Copyright 2013-2018 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,8 +38,8 @@ public: virtual ~IconList() {}; QIcon getIcon(const QString &key) const; - QIcon getBigIcon(const QString &key) const; int getIconIndex(const QString &key) const; + QString getDirectory() const; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; diff --git a/api/gui/icons/MMCIcon.cpp b/api/gui/icons/MMCIcon.cpp index 8fe4cbfc..92518e01 100644 --- a/api/gui/icons/MMCIcon.cpp +++ b/api/gui/icons/MMCIcon.cpp @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 MultiMC Contributors +/* Copyright 2013-2018 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/api/gui/icons/MMCIcon.h b/api/gui/icons/MMCIcon.h index dd65eebd..8c6752ea 100644 --- a/api/gui/icons/MMCIcon.h +++ b/api/gui/icons/MMCIcon.h @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 MultiMC Contributors +/* Copyright 2013-2018 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |