X-Git-Url: https://git.sur5r.net/?p=minitube;a=blobdiff_plain;f=src%2Floadingwidget.cpp;h=66ec79d2a1eafcb9f4a48ac1d559a8a696677ec6;hp=13e7cb6c882e68c6f175e772ef4fa67a54f127bc;hb=434d88418722fd7717038e44bd74271ca1d92771;hpb=2fe4558f7d5d98052be981a66fbe16d0587ba030 diff --git a/src/loadingwidget.cpp b/src/loadingwidget.cpp index 13e7cb6..66ec79d 100644 --- a/src/loadingwidget.cpp +++ b/src/loadingwidget.cpp @@ -75,7 +75,7 @@ void LoadingWidget::setVideo(Video *video) { titleLabel->setText(title); titleLabel->setVisible(window()->height() > 100); - const int maxDescLength = 400; + const int maxDescLength = 500; QString videoDesc = video->getDescription(); if (videoDesc.length() > maxDescLength) { @@ -106,8 +106,9 @@ void LoadingWidget::setError(const QString &message) { progressBar->setValue(0); } -void LoadingWidget::bufferStatus(int percent) { - if (startTime.elapsed() > 2000 && percent > progressBar->value()) +void LoadingWidget::bufferStatus(qreal value) { + int percent = value * 100.; + if (startTime.elapsed() > 1000 && percent > progressBar->value()) progressBar->setValue(percent); } @@ -122,8 +123,9 @@ void LoadingWidget::adjustFontSize() { layout()->setMargin(spacing); titleLabel->setFont(f); - f.setPixelSize(f.pixelSize() / 2); - descriptionLabel->setFont(f); + QFont descFont = descriptionLabel->font(); + descFont.setPixelSize(f.pixelSize() / 2); + descriptionLabel->setFont(descFont); } void LoadingWidget::clear() {