gui: rspermissionmatrixwidget: fix name.length check with proper number

This commit is contained in:
chelovechishko 2019-02-16 23:32:00 +09:00
parent 5009a4e243
commit 55ff018166

View File

@ -289,7 +289,8 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *)
rsPeers->getPeerDetails(*it,details) ;
QString name = QString::fromUtf8(details.name.c_str()) + " (" + QString::fromUtf8(details.location.c_str()) + ")";
if(name.length() > 20)
// TODO does not work correctly with hieroglyphs
if(name.length() > 20 + 3)
name = name.left(20)+"..." ;
peer_name_size = std::max(peer_name_size, fm.width(name)) ;