mirror of
https://github.com/stenzek/duckstation.git
synced 2026-02-16 19:34:38 +00:00
Qt: Fix memory card icons drawing on themselves
Also disable column title highlighting, and fix the width of the icon column.
This commit is contained in:
@@ -57,8 +57,8 @@ public:
|
||||
if (const QPixmap* icon_frame = getIconFrame(static_cast<size_t>(index.row()), m_current_frame_index, rc))
|
||||
{
|
||||
// center the icon in the available space
|
||||
const int x = std::max((rc.width() - MEMORY_CARD_ICON_SIZE) / 2, 0);
|
||||
const int y = std::max((rc.height() - MEMORY_CARD_ICON_SIZE) / 2, 0);
|
||||
const int x = rc.x() + std::max((rc.width() - MEMORY_CARD_ICON_SIZE) / 2, 0);
|
||||
const int y = rc.y() + std::max((rc.height() - MEMORY_CARD_ICON_SIZE) / 2, 0);
|
||||
painter->drawPixmap(x, y, *icon_frame);
|
||||
}
|
||||
}
|
||||
@@ -143,8 +143,8 @@ MemoryCardEditorWindow::MemoryCardEditorWindow() : QWidget()
|
||||
m_card_b.table = m_ui.cardB;
|
||||
m_card_b.blocks_free_label = m_ui.cardBUsage;
|
||||
|
||||
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);
|
||||
m_file_icon_width = MEMORY_CARD_ICON_SIZE + (m_card_a.table->showGrid() ? 1 : 0);
|
||||
m_file_icon_height = MEMORY_CARD_ICON_SIZE + (m_card_a.table->showGrid() ? 1 : 0);
|
||||
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});
|
||||
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectionBehavior::SelectRows</enum>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderHighlightSections">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
@@ -180,6 +183,9 @@
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectionBehavior::SelectRows</enum>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderHighlightSections">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
|
||||
Reference in New Issue
Block a user