1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(friendwidget):the limitation of the group's name in the shortcut menu

close #3201
add the limitation of the group's  name in the shortcut menu
the exclusion of the possibility of incorrect display the context menu, caused by the long group name
This commit is contained in:
PKEv 2016-04-25 20:40:51 +03:00
parent 6dd1cd0320
commit d357fe1c65

View File

@ -89,7 +89,13 @@ void FriendWidget::contextMenuEvent(QContextMenuEvent * event)
for (Group* group : GroupList::getAllGroups())
{
QAction* groupAction = inviteMenu->addAction(tr("Invite to group '%1'").arg(group->getGroupWidget()->getName()));
int maxNameLen = 30;
QString name = group->getGroupWidget()->getName();
if ( name.length() > maxNameLen )
{
name = name.left(maxNameLen).trimmed() + "..";
}
QAction* groupAction = inviteMenu->addAction(tr("Invite to group '%1'").arg(name));
groupActions[groupAction] = group;
}