aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2022-06-19 23:01:31 -0300
committerflow <flowlnlnln@gmail.com>2022-06-21 06:41:56 -0300
commita135c06bcfb70da4a74d1ba671f8dff04e199dc5 (patch)
treeef67248fc078298a21aba2f3216771ea17096aaf
parent03e454b71d83aebbb534c5734ccd9093842da28c (diff)
downloadPrismLauncher-a135c06bcfb70da4a74d1ba671f8dff04e199dc5.tar.gz
PrismLauncher-a135c06bcfb70da4a74d1ba671f8dff04e199dc5.tar.bz2
PrismLauncher-a135c06bcfb70da4a74d1ba671f8dff04e199dc5.zip
fix: scale mod icons to the right size
-rw-r--r--launcher/ui/pages/modplatform/ModModel.cpp6
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp1
2 files changed, 6 insertions, 1 deletions
diff --git a/launcher/ui/pages/modplatform/ModModel.cpp b/launcher/ui/pages/modplatform/ModModel.cpp
index 98eec31c..4917b890 100644
--- a/launcher/ui/pages/modplatform/ModModel.cpp
+++ b/launcher/ui/pages/modplatform/ModModel.cpp
@@ -53,7 +53,11 @@ auto ListModel::data(const QModelIndex& index, int role) const -> QVariant
}
case Qt::DecorationRole: {
if (m_logoMap.contains(pack.logoName)) {
- return (m_logoMap.value(pack.logoName));
+ auto icon = m_logoMap.value(pack.logoName);
+ // FIXME: This doesn't really belong here, but Qt doesn't offer a good way right now ;(
+ auto icon_scaled = QIcon(icon.pixmap(48, 48).scaledToWidth(48));
+
+ return icon_scaled;
}
QIcon icon = APPLICATION->getThemedIcon("screenshot-placeholder");
// un-const-ify this
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
index 07d1687c..a0050e50 100644
--- a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
+++ b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
@@ -87,6 +87,7 @@ auto ModpackListModel::data(const QModelIndex& index, int role) const -> QVarian
} else if (role == Qt::DecorationRole) {
if (m_logoMap.contains(pack.iconName)) {
auto icon = m_logoMap.value(pack.iconName);
+ // FIXME: This doesn't really belong here, but Qt doesn't offer a good way right now ;(
auto icon_scaled = QIcon(icon.pixmap(48, 48).scaledToWidth(48));
return icon_scaled;