Skip to content

Commit cd8d6d8

Browse files
committed
Qt: Remove game icon extra size
Looks worse because the icon is significantly larger than the text.
1 parent f6cdf95 commit cd8d6d8

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/duckstation-qt/gamelistwidget.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ static constexpr int GAME_ICON_MIN_SIZE = 16;
5151
static constexpr int GAME_ICON_DEFAULT_SIZE = 16;
5252
static constexpr int GAME_ICON_MAX_SIZE = 80;
5353
static constexpr int GAME_ICON_SIZE_STEP = 4;
54-
// Nasty magic number here, +8 gets us a height of 24 at 16 icon size, which looks good.
55-
static constexpr int GAME_ICON_EXTRA_SIZE = 8;
56-
static constexpr int GAME_ICON_PADDING = 3;
54+
static constexpr int GAME_ICON_PADDING = 12;
5755
static constexpr int GAME_ICON_ANIMATION_LOOPS = 5;
5856

5957
static constexpr float MIN_COVER_SCALE = 0.1f;
@@ -248,7 +246,7 @@ void GameListModel::refreshIcons()
248246

249247
int GameListModel::getIconSizeWithPadding() const
250248
{
251-
return m_icon_size + GAME_ICON_EXTRA_SIZE + GAME_ICON_PADDING * 2;
249+
return m_icon_size + GAME_ICON_PADDING;
252250
}
253251

254252
void GameListModel::setIconSize(int size)
@@ -534,7 +532,7 @@ const QPixmap* GameListModel::lookupIconPixmapForEntry(const GameList::Entry* ge
534532
QPixmap pm;
535533
if (!path.empty() && pm.load(QString::fromStdString(path)))
536534
{
537-
resizeGameIcon(pm, m_icon_size + GAME_ICON_EXTRA_SIZE, m_device_pixel_ratio);
535+
resizeGameIcon(pm, m_icon_size, m_device_pixel_ratio);
538536
return m_icon_pixmap_cache.Insert(ge->serial, std::move(pm));
539537
}
540538

@@ -1145,7 +1143,7 @@ bool GameListModel::lessThan(const GameList::Entry* left, const GameList::Entry*
11451143

11461144
void GameListModel::loadSizeDependentPixmaps()
11471145
{
1148-
const QSize icon_size = QSize(m_icon_size + GAME_ICON_EXTRA_SIZE, m_icon_size + GAME_ICON_EXTRA_SIZE);
1146+
const QSize icon_size = QSize(m_icon_size, m_icon_size);
11491147
for (u32 i = 0; i < static_cast<u32>(GameList::EntryType::MaxCount); i++)
11501148
{
11511149
m_type_pixmaps[i] =
@@ -1446,7 +1444,7 @@ class GameListAnimatedIconDelegate final : public QStyledItemDelegate
14461444
{
14471445
QPixmap pm = QPixmap::fromImage(QImage(reinterpret_cast<uchar*>(image.GetPixels(i)), image.GetWidth(),
14481446
image.GetHeight(), QImage::Format::Format_RGBA8888));
1449-
resizeGameIcon(pm, m_model->getIconSize() + GAME_ICON_EXTRA_SIZE, m_model->getDevicePixelRatio());
1447+
resizeGameIcon(pm, m_model->getIconSize(), m_model->getDevicePixelRatio());
14501448
m_frame_pixmaps.push_back(std::move(pm));
14511449
}
14521450

0 commit comments

Comments
 (0)