mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-29 14:50:20 +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
|
else
|
||||||
return {};
|
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:
|
case Qt::InitialSortOrderRole:
|
||||||
{
|
{
|
||||||
const int column = index.column();
|
const int column = index.column();
|
||||||
@ -604,20 +610,14 @@ QVariant GameListModel::data(const QModelIndex& index, int role, const GameList:
|
|||||||
switch (index.column())
|
switch (index.column())
|
||||||
{
|
{
|
||||||
case Column_Icon:
|
case Column_Icon:
|
||||||
{
|
|
||||||
return getIconPixmapForEntry(ge);
|
return getIconPixmapForEntry(ge);
|
||||||
}
|
|
||||||
|
|
||||||
case Column_Region:
|
case Column_Region:
|
||||||
{
|
|
||||||
return getFlagPixmapForEntry(ge);
|
return getFlagPixmapForEntry(ge);
|
||||||
}
|
|
||||||
|
|
||||||
case Column_Compatibility:
|
case Column_Compatibility:
|
||||||
{
|
|
||||||
return m_compatibility_pixmaps[static_cast<u32>(ge->dbentry ? ge->dbentry->compatibility :
|
return m_compatibility_pixmaps[static_cast<u32>(ge->dbentry ? ge->dbentry->compatibility :
|
||||||
GameDatabase::CompatibilityRating::Unknown)];
|
GameDatabase::CompatibilityRating::Unknown)];
|
||||||
}
|
|
||||||
|
|
||||||
case Column_Cover:
|
case Column_Cover:
|
||||||
{
|
{
|
||||||
@ -630,16 +630,11 @@ QVariant GameListModel::data(const QModelIndex& index, int role, const GameList:
|
|||||||
const_cast<GameListModel*>(this)->loadOrGenerateCover(ge);
|
const_cast<GameListModel*>(this)->loadOrGenerateCover(ge);
|
||||||
return *m_cover_pixmap_cache.Insert(ge->path, m_loading_pixmap);
|
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
|
QVariant GameListModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user