mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 09:04:53 -07:00
Fix size and image quality issues with new user icons (#5546)
This commit is contained in:
parent
a0b52ce450
commit
1de09deb59
8 changed files with 50 additions and 18 deletions
|
|
@ -50,6 +50,7 @@ GameSelector::GameSelector(AbstractClient *_client,
|
|||
} else {
|
||||
gameListView->setModel(gameListModel);
|
||||
}
|
||||
gameListView->setIconSize(QSize(13, 13));
|
||||
gameListView->setSortingEnabled(true);
|
||||
gameListView->sortByColumn(gameListModel->startTimeColIndex(), Qt::AscendingOrder);
|
||||
gameListView->setAlternatingRowColors(true);
|
||||
|
|
|
|||
|
|
@ -118,11 +118,10 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const
|
|||
case Qt::DisplayRole:
|
||||
return QString::fromStdString(gameentry.creator_info().name());
|
||||
case Qt::DecorationRole: {
|
||||
QPixmap avatarPixmap = UserLevelPixmapGenerator::generatePixmap(
|
||||
13, (UserLevelFlags)gameentry.creator_info().user_level(),
|
||||
return UserLevelPixmapGenerator::generateIcon(
|
||||
13, UserLevelFlags(gameentry.creator_info().user_level()),
|
||||
gameentry.creator_info().pawn_colors(), false,
|
||||
QString::fromStdString(gameentry.creator_info().privlevel()));
|
||||
return QIcon(avatarPixmap);
|
||||
}
|
||||
default:
|
||||
return QVariant();
|
||||
|
|
|
|||
|
|
@ -140,9 +140,9 @@ void PlayerListWidget::updatePlayerProperties(const ServerInfo_PlayerProperties
|
|||
}
|
||||
if (prop.has_user_info()) {
|
||||
player->setData(3, Qt::UserRole, prop.user_info().user_level());
|
||||
player->setIcon(3, QIcon(UserLevelPixmapGenerator::generatePixmap(
|
||||
player->setIcon(3, UserLevelPixmapGenerator::generateIcon(
|
||||
12, UserLevelFlags(prop.user_info().user_level()), prop.user_info().pawn_colors(), false,
|
||||
QString::fromStdString(prop.user_info().privlevel()))));
|
||||
QString::fromStdString(prop.user_info().privlevel())));
|
||||
player->setText(4, QString::fromStdString(prop.user_info().name()));
|
||||
const QString country = QString::fromStdString(prop.user_info().country());
|
||||
if (!country.isEmpty())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue