diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-04 23:44:28 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-04 23:44:28 -0700 |
commit | 9913080a829acb4ca921c3a68e0caefad0ebcaa1 (patch) | |
tree | e20fc6130e319b227672de26e62117035bca1fcf /launcher/minecraft | |
parent | ec157b766efd9eb781a8ca85fb9c28674e073da0 (diff) | |
download | PrismLauncher-9913080a829acb4ca921c3a68e0caefad0ebcaa1.tar.gz PrismLauncher-9913080a829acb4ca921c3a68e0caefad0ebcaa1.tar.bz2 PrismLauncher-9913080a829acb4ca921c3a68e0caefad0ebcaa1.zip |
feat(modpage): mod icon in description and column
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/minecraft')
-rw-r--r-- | launcher/minecraft/mod/ModFolderModel.cpp | 8 | ||||
-rw-r--r-- | launcher/minecraft/mod/ModFolderModel.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/launcher/minecraft/mod/ModFolderModel.cpp b/launcher/minecraft/mod/ModFolderModel.cpp index 6ae25d33..8a58b9d7 100644 --- a/launcher/minecraft/mod/ModFolderModel.cpp +++ b/launcher/minecraft/mod/ModFolderModel.cpp @@ -57,7 +57,7 @@ ModFolderModel::ModFolderModel(const QString& dir, std::shared_ptr<const BaseInstance> instance, bool is_indexed, bool create_dir) : ResourceFolderModel(QDir(dir), instance, nullptr, create_dir), m_is_indexed(is_indexed) { - m_column_sort_keys = { SortType::ENABLED, SortType::NAME, SortType::VERSION, SortType::DATE, SortType::PROVIDER }; + m_column_sort_keys = { SortType::ENABLED, SortType::NAME, SortType::VERSION, SortType::DATE, SortType::PROVIDER, SortType::NAME }; } QVariant ModFolderModel::data(const QModelIndex &index, int role) const @@ -118,7 +118,9 @@ QVariant ModFolderModel::data(const QModelIndex &index, int role) const case Qt::DecorationRole: { if (column == NAME_COLUMN && (at(row)->isSymLinkUnder(instDirPath()) || at(row)->isMoreThanOneHardLink())) return APPLICATION->getThemedIcon("status-yellow"); - + if (column == ImageColumn) { + return at(row)->icon(QSize(64, 64), Qt::AspectRatioMode::KeepAspectRatioByExpanding); + } return {}; } case Qt::CheckStateRole: @@ -151,6 +153,8 @@ QVariant ModFolderModel::headerData(int section, Qt::Orientation orientation, in return tr("Last changed"); case ProviderColumn: return tr("Provider"); + case ImageColumn: + return tr("Image"); default: return QVariant(); } diff --git a/launcher/minecraft/mod/ModFolderModel.h b/launcher/minecraft/mod/ModFolderModel.h index 46f5087f..20018e9c 100644 --- a/launcher/minecraft/mod/ModFolderModel.h +++ b/launcher/minecraft/mod/ModFolderModel.h @@ -68,6 +68,7 @@ public: VersionColumn, DateColumn, ProviderColumn, + ImageColumn, NUM_COLUMNS }; enum ModStatusAction { |