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

FileTransferInstance: use correct fontmetrics

This commit is contained in:
krepa098 2014-10-05 14:47:22 +02:00
parent 8e664b5ff7
commit 77d7189d66

View File

@ -16,6 +16,7 @@
#include "filetransferinstance.h"
#include "core.h"
#include "misc/style.h"
#include <math.h>
#include <QFileDialog>
#include <QMessageBox>
@ -38,9 +39,10 @@ FileTransferInstance::FileTransferInstance(ToxFile File)
lastUpdateTime = QDateTime::currentDateTime();
filename = File.fileName;
QFont font;
font.setPixelSize(10);
QFontMetrics fm(font);
// update this whenever you change the font in innerStyle.css
QFontMetrics fm(Style::getFont(Style::Small));
filenameElided = fm.elidedText(filename, Qt::ElideRight, CONTENT_WIDTH);
size = getHumanReadableSize(File.filesize);