diff options
author | Weblate <noreply@weblate.org> | 2017-11-04 19:28:17 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2017-11-04 19:28:17 +0000 |
commit | 7787f617656751ee7e0a58c813d0bfd5757c5c97 (patch) | |
tree | 48aa053bbd4fda9c64f89a061a2f442c860ab13d /src-qt5/core/libLumina/LVideoWidget.cpp | |
parent | Translated using Weblate (Lithuanian) (diff) | |
parent | Merge pull request #497 from a-stjohn/patch-1 (diff) | |
download | lumina-7787f617656751ee7e0a58c813d0bfd5757c5c97.tar.gz lumina-7787f617656751ee7e0a58c813d0bfd5757c5c97.tar.bz2 lumina-7787f617656751ee7e0a58c813d0bfd5757c5c97.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/libLumina/LVideoWidget.cpp')
-rw-r--r-- | src-qt5/core/libLumina/LVideoWidget.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src-qt5/core/libLumina/LVideoWidget.cpp b/src-qt5/core/libLumina/LVideoWidget.cpp new file mode 100644 index 00000000..f1f74414 --- /dev/null +++ b/src-qt5/core/libLumina/LVideoWidget.cpp @@ -0,0 +1,38 @@ +#include "LVideoWidget.h" + +LVideoWidget::LVideoWidget(QString file, QSize iconSize, bool icons, QWidget *parent) : QWidget(parent) { + iconLabel = new LVideoLabel(file, icons, parent); + textLabel = new QLabel(parent); + + layout = new QHBoxLayout(this); + layout->setAlignment(Qt::AlignLeft | Qt::AlignCenter); + layout->setContentsMargins(5,5,5,5); + layout->setStretchFactor(textLabel, 1); //make sure this always occupies all extra space + + textLabel->setText(file.section("/", -1)); + iconLabel->setGeometry(QRect(QPoint(0,0), iconSize)); + iconLabel->setFixedSize(iconSize); + iconLabel->setVisible(true); + textLabel->setVisible(true); + + layout->addWidget(iconLabel); + layout->addWidget(textLabel); +} + +LVideoWidget::~LVideoWidget() { + delete iconLabel; + delete textLabel; + delete layout; +} + +void LVideoWidget::setIconSize(QSize iconSize) { + iconLabel->setFixedSize(iconSize); +} + +void LVideoWidget::enableIcons() { + iconLabel->enableIcons(); +} + +void LVideoWidget::disableIcons() { + iconLabel->disableIcons(); +} |