Qt: Force memory card editor icons to 32x32

This commit is contained in:
Stenzek
2025-08-24 01:31:58 +10:00
parent d4b85ef6f1
commit 3b1dcde36f
2 changed files with 9 additions and 2 deletions

View File

@@ -37,6 +37,7 @@ static constexpr std::array<std::pair<ConsoleRegion, const char*>, 3> MEMORY_CAR
{ConsoleRegion::NTSC_J, "BI"},
{ConsoleRegion::PAL, "BE"},
}};
static constexpr int MEMORY_CARD_ICON_SIZE = 32;
static constexpr int MEMORY_CARD_ICON_FRAME_DURATION_MS = 200;
namespace {
@@ -141,8 +142,10 @@ MemoryCardEditorWindow::MemoryCardEditorWindow() : QWidget()
m_card_b.table = m_ui.cardB;
m_card_b.blocks_free_label = m_ui.cardBUsage;
QtUtils::SetColumnWidthsForTableView(m_card_a.table, {32, -1, 155, 45});
QtUtils::SetColumnWidthsForTableView(m_card_b.table, {32, -1, 155, 45});
m_file_icon_width = MEMORY_CARD_ICON_SIZE + style()->pixelMetric(QStyle::PM_FocusFrameHMargin, nullptr, this);
m_file_icon_height = MEMORY_CARD_ICON_SIZE + style()->pixelMetric(QStyle::PM_FocusFrameVMargin, nullptr, this);
QtUtils::SetColumnWidthsForTableView(m_card_a.table, {m_file_icon_width, -1, 155, 45});
QtUtils::SetColumnWidthsForTableView(m_card_b.table, {m_file_icon_width, -1, 155, 45});
createCardButtons(&m_card_a, m_ui.buttonBoxA);
createCardButtons(&m_card_b, m_ui.buttonBoxB);
@@ -381,6 +384,8 @@ void MemoryCardEditorWindow::updateCardTable(Card* card)
const int row = card->table->rowCount();
card->table->insertRow(row);
card->table->setRowHeight(row, m_file_icon_height);
QString title_str(QString::fromStdString(fi.title));
if (fi.deleted)
title_str += tr(" (Deleted)");

View File

@@ -99,6 +99,8 @@ private:
Card m_card_a;
Card m_card_b;
u32 m_current_frame_index = 0;
int m_file_icon_width = 0;
int m_file_icon_height = 0;
QTimer* m_animation_timer = nullptr;
};