mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-28 22:30:11 +00:00
Qt: Right align size columns in game list view
This commit is contained in:
parent
00330ca391
commit
873c7c9dc3
@ -584,12 +584,18 @@ QVariant GameListModel::data(const QModelIndex& index, int role, const GameList:
|
||||
else
|
||||
return {};
|
||||
}
|
||||
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
case Qt::TextAlignmentRole:
|
||||
{
|
||||
const int column = index.column();
|
||||
if (column == Column_FileSize || column == Column_UncompressedSize)
|
||||
return (Qt::AlignRight | Qt::AlignVCenter).toInt();
|
||||
else
|
||||
return {};
|
||||
}
|
||||
|
||||
case Qt::InitialSortOrderRole:
|
||||
{
|
||||
const int column = index.column();
|
||||
@ -604,20 +610,14 @@ QVariant GameListModel::data(const QModelIndex& index, int role, const GameList:
|
||||
switch (index.column())
|
||||
{
|
||||
case Column_Icon:
|
||||
{
|
||||
return getIconPixmapForEntry(ge);
|
||||
}
|
||||
|
||||
case Column_Region:
|
||||
{
|
||||
return getFlagPixmapForEntry(ge);
|
||||
}
|
||||
|
||||
case Column_Compatibility:
|
||||
{
|
||||
return m_compatibility_pixmaps[static_cast<u32>(ge->dbentry ? ge->dbentry->compatibility :
|
||||
GameDatabase::CompatibilityRating::Unknown)];
|
||||
}
|
||||
|
||||
case Column_Cover:
|
||||
{
|
||||
@ -630,16 +630,11 @@ QVariant GameListModel::data(const QModelIndex& index, int role, const GameList:
|
||||
const_cast<GameListModel*>(this)->loadOrGenerateCover(ge);
|
||||
return *m_cover_pixmap_cache.Insert(ge->path, m_loading_pixmap);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
QVariant GameListModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user