[UI] Make completer length font size relative

This commit is contained in:
Klaus Basan
2020-04-16 23:50:54 +02:00
committed by Mat Sutcliffe
parent 668659248e
commit 70c88f0982
7 changed files with 21 additions and 11 deletions

View File

@@ -457,7 +457,8 @@ namespace BlackGui
if (!airports.isEmpty())
{
QCompleter *airportCompleter = new QCompleter(airports, this);
airportCompleter->popup()->setMinimumWidth(75);
const int w5chars = airportCompleter->popup()->fontMetrics().size(Qt::TextSingleLine, "FooBa").width();
airportCompleter->popup()->setMinimumWidth(w5chars * 5);
ui->le_AtcStationsOnlineMetar->setCompleter(airportCompleter);
}
}