Choose cyclist default to no avatar (#4814)

Minor change, but it does make selecting an athlete with no avatar easier.
This commit is contained in:
Paul Johnson
2026-01-24 18:44:43 +00:00
committed by GitHub
parent f6d4f6a6cb
commit 663526cd49

View File

@@ -110,11 +110,14 @@ ChooseCyclistDialog::getList()
QListWidgetItem *newone = new QListWidgetItem(name, listWidget); QListWidgetItem *newone = new QListWidgetItem(name, listWidget);
// get avatar image if it exists // get avatar image if it exists, otherwise default to noavatar.png
QString iconpath = home.absolutePath() + "/" + name + "/config/avatar.png"; QString iconpath = home.absolutePath() + "/" + name + "/config/avatar.png";
if (QFile(iconpath).exists()) { if (QFile(iconpath).exists()) {
QPixmap px(iconpath); QPixmap px(iconpath);
newone->setIcon(QIcon(px.scaled(64 *dpiXFactor,64 *dpiYFactor))); newone->setIcon(QIcon(px.scaled(64 *dpiXFactor,64 *dpiYFactor)));
} else {
QPixmap px(":images/noavatar.png");
newone->setIcon(QIcon(px.scaled(64 *dpiXFactor,64 *dpiYFactor)));
} }
// taller less spacing // taller less spacing
@@ -220,6 +223,9 @@ ChooseCyclistDialog::newClicked()
if (QFile(iconpath).exists()) { if (QFile(iconpath).exists()) {
QPixmap px(iconpath); QPixmap px(iconpath);
newone->setIcon(QIcon(px.scaled(64 *dpiXFactor,64 *dpiYFactor))); newone->setIcon(QIcon(px.scaled(64 *dpiXFactor,64 *dpiYFactor)));
} else {
QPixmap px(":images/noavatar.png");
newone->setIcon(QIcon(px.scaled(64 *dpiXFactor,64 *dpiYFactor)));
} }
// taller less spacing // taller less spacing