#326 shortened too long usernames in gui

This commit is contained in:
Kai Philipp
2017-04-05 15:55:48 +02:00
parent 6bf732f219
commit f3f31519d4
+12 -2
View File
@@ -93,10 +93,20 @@ void MyNameLabel::setText ( const QString &t, bool trans, bool guest, bool compu
linkString = QString("http://pokerth.net/redirect_user_profile.php?nick="+QUrl::toPercentEncoding(t));
}
// truncate nicknames longer than 10 characters
QString t2 = t;
if(t2.size() > 10){
int chop = t.size() - 10 - 3;
t2.chop(chop);
t2.append("...");
}
QString tTruncated;
if(trans) {
text = "<a style='color: rgba("+red+", "+green+", "+blue+", 80);' href='"+linkString+"'>"+t+"</a>";
text = "<a style='color: rgba("+red+", "+green+", "+blue+", 80);' href='"+linkString+"'>"+t2+"</a>";
} else {
text = "<a style='color: #"+myW->getMyGameTableStyle()->getPlayerNickTextColor()+";' href='"+linkString+"'>"+t+"</a>";
text = "<a style='color: #"+myW->getMyGameTableStyle()->getPlayerNickTextColor()+";' href='"+linkString+"'>"+t2+"</a>";
}
} else {