]> git.sur5r.net Git - minitube/blobdiff - src/loadingwidget.cpp
New upstream version 3.1
[minitube] / src / loadingwidget.cpp
index 13e7cb6c882e68c6f175e772ef4fa67a54f127bc..66ec79d2a1eafcb9f4a48ac1d559a8a696677ec6 100644 (file)
@@ -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() {