blob: f1f7441466a0f97d97d5e65b5598bb14b954995f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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();
}
|