mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(ui): don't duplicate group peer name in tooltip
This commit is contained in:
parent
b7bd7c6215
commit
87a53fad96
|
@ -241,12 +241,14 @@ void GroupChatForm::updateUserNames()
|
||||||
* and then sort them by their text and add them to the layout in that order */
|
* and then sort them by their text and add them to the layout in that order */
|
||||||
const auto selfPk = Core::getInstance()->getSelfPublicKey();
|
const auto selfPk = Core::getInstance()->getSelfPublicKey();
|
||||||
for (const auto& peerPk : peers.keys()) {
|
for (const auto& peerPk : peers.keys()) {
|
||||||
const QString fullName = FriendList::decideNickname(peerPk, peers.value(peerPk));
|
const QString peerName = peers.value(peerPk);
|
||||||
const QString editedName = editName(fullName).append(QLatin1String(", "));
|
const QString editedName = editName(peerName);
|
||||||
QLabel* const label = new QLabel(editedName);
|
QLabel* const label = new QLabel(editedName + QLatin1String(", "));
|
||||||
if (editedName != fullName) {
|
if (editedName != peerName) {
|
||||||
label->setToolTip(fullName + " (" + peerPk.toString() + ")");
|
label->setToolTip(peerName + " (" + peerPk.toString() + ")");
|
||||||
}
|
} else if (peerName != peerPk.toString()) {
|
||||||
|
label->setToolTip(peerPk.toString());
|
||||||
|
} // else their name is just their Pk, no tooltip needed
|
||||||
label->setTextFormat(Qt::PlainText);
|
label->setTextFormat(Qt::PlainText);
|
||||||
label->setContextMenuPolicy(Qt::CustomContextMenu);
|
label->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user