aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/LVideoWidget.cpp
blob: 144904840c8b93097c6def6df33ebd414a0f884f (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
#include "LVideoWidget.h"

LVideoWidget::LVideoWidget(QString file, QSize iconSize, QWidget *parent) : QWidget(parent) {
  flag = false;
  iconLabel = new LVideoLabel(file, parent);
  textLabel = new QLabel(parent);

  layout = new QHBoxLayout(this);
  layout->setAlignment(Qt::AlignLeft | Qt::AlignCenter);
  layout->addWidget(iconLabel);
  layout->addWidget(textLabel);
  layout->setStretchFactor(textLabel, 1); //make sure this always occupies all extra space

  textLabel->setText(file.section("/", -1));
  iconLabel->setFixedSize(iconSize);
  iconLabel->setVisible(true);
  textLabel->setVisible(true);
}

LVideoWidget::~LVideoWidget() {
  delete iconLabel;
  delete textLabel;
  delete layout;
}

void LVideoWidget::setIconSize(QSize iconSize) {
  iconLabel->setFixedSize(iconSize);
}
bgstack15