mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 00:42:14 -07:00
directly use generateIcon in remaining places
This commit is contained in:
parent
2e57c95dad
commit
06edbf5ee4
2 changed files with 4 additions and 4 deletions
|
|
@ -809,10 +809,10 @@ void TabSupervisor::processUserJoined(const ServerInfo_User &userInfoJoined)
|
||||||
if (auto *tab = getTabAccount()) {
|
if (auto *tab = getTabAccount()) {
|
||||||
if (tab != currentWidget()) {
|
if (tab != currentWidget()) {
|
||||||
tab->setContentsChanged(true);
|
tab->setContentsChanged(true);
|
||||||
QPixmap avatarPixmap = UserLevelPixmapGenerator::generatePixmap(
|
QIcon avatarIcon = UserLevelPixmapGenerator::generateIcon(
|
||||||
13, (UserLevelFlags)userInfoJoined.user_level(), userInfoJoined.pawn_colors(), true,
|
13, (UserLevelFlags)userInfoJoined.user_level(), userInfoJoined.pawn_colors(), true,
|
||||||
QString::fromStdString(userInfoJoined.privlevel()));
|
QString::fromStdString(userInfoJoined.privlevel()));
|
||||||
setTabIcon(indexOf(tab), QPixmap(avatarPixmap));
|
setTabIcon(indexOf(tab), avatarIcon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,9 @@ void PlayerListWidget::updatePlayerProperties(const ServerInfo_PlayerProperties
|
||||||
}
|
}
|
||||||
if (prop.has_user_info()) {
|
if (prop.has_user_info()) {
|
||||||
player->setData(3, Qt::UserRole, prop.user_info().user_level());
|
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,
|
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()));
|
player->setText(4, QString::fromStdString(prop.user_info().name()));
|
||||||
const QString country = QString::fromStdString(prop.user_info().country());
|
const QString country = QString::fromStdString(prop.user_info().country());
|
||||||
if (!country.isEmpty())
|
if (!country.isEmpty())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue