diff options
author | ZackaryWelch <welch.zackary@gmail.com> | 2017-10-16 21:00:07 -0400 |
---|---|---|
committer | ZackaryWelch <welch.zackary@gmail.com> | 2017-10-16 21:00:07 -0400 |
commit | cd928a79ff4bf6da55689bc100168355ec962b50 (patch) | |
tree | 0c06d52e780936d1fc9bc29ead53876837b94133 /src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | |
parent | Clean up the session file-init routine. (diff) | |
download | lumina-cd928a79ff4bf6da55689bc100168355ec962b50.tar.gz lumina-cd928a79ff4bf6da55689bc100168355ec962b50.tar.bz2 lumina-cd928a79ff4bf6da55689bc100168355ec962b50.zip |
Updated how video thumbnails are loaded. Now cached to stop crash when
resizing.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp index 4ec8fae7..58ef8cbd 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp @@ -80,12 +80,17 @@ void MainUI::LoadFile(QString path, QString type){ else{ ftype = INFO->suffix().toUpper(); } if(INFO->isHidden()){ ftype = QString(tr("Hidden %1")).arg(type); } ui->label_file_type->setText(ftype); + //Now load the icon for the file if(INFO->isImage()){ - ui->label_file_icon = new LVideoLabel(INFO->absoluteFilePath(), false); - //ui->label_file_size->setText( ui->label_file_size->text()+" ("+QString::number(pix.width())+" x "+QString::number(pix.height())+" px)" ); + QPixmap pix(INFO->absoluteFilePath()); + ui->label_file_icon->setPixmap(pix.scaledToHeight(64)); + ui->label_file_size->setText( ui->label_file_size->text()+" ("+QString::number(pix.width())+" x "+QString::number(pix.height())+" px)" ); }else if(INFO->isVideo()){ - ui->label_file_icon = new LVideoLabel(INFO->absoluteFilePath(), true); + ui->label_file_icon->hide(); + LVideoLabel *mediaLabel = new LVideoLabel(INFO->absoluteFilePath(), ui->tab_file); + mediaLabel->setShrinkPixmap(true); + ui->formLayout->replaceWidget(ui->label_file_icon, mediaLabel); }else{ ui->label_file_icon->setPixmap( LXDG::findIcon( INFO->iconfile(), "unknown").pixmap(QSize(64,64)) ); } @@ -101,6 +106,7 @@ void MainUI::LoadFile(QString path, QString type){ ui->tabWidget->removeTab( ui->tabWidget->indexOf(ui->tab_file) ); } } + //Now load the special XDG desktop info qDebug() << "Check XDG Info:" << type; //qDebug() << INFO->isDesktopFile() << type; |