Fixed size previews
This commit is contained in:
parent
c621c0db3e
commit
e573f3d014
@ -16,19 +16,23 @@ RecordingPreview::RecordingPreview(QRect area, QWidget *parent) : QWidget(parent
|
||||
QTimer::singleShot(0, [&] {
|
||||
adjustSize();
|
||||
move(0, 0);
|
||||
if (geometry().intersects(recordingArea)) // Formatter please
|
||||
if (rect().intersects(recordingArea)) // Formatter please
|
||||
move(QApplication::primaryScreen()->size().width() - rect().width(), 0);
|
||||
if (geometry().intersects(recordingArea)) // Formatter please
|
||||
if (rect().intersects(recordingArea)) // Formatter please
|
||||
move(0, QApplication::primaryScreen()->size().height() - rect().height());
|
||||
if (geometry().intersects(recordingArea))
|
||||
if (rect().intersects(recordingArea))
|
||||
move(QApplication::primaryScreen()->size().width() - rect().width(),
|
||||
QApplication::primaryScreen()->size().height() - rect().height());
|
||||
if (!geometry().intersects(recordingArea)) show();
|
||||
if (!rect().intersects(recordingArea)) show();
|
||||
});
|
||||
label = new QLabel;
|
||||
hintLabel = new QLabel;
|
||||
auto ly = new QGridLayout(this);
|
||||
setLayout(ly);
|
||||
auto size = recordingArea.size().scaled(QSize(300, 300), Qt::KeepAspectRatio);
|
||||
label->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
|
||||
label->setMaximumSize(size);
|
||||
label->resize(size);
|
||||
layout()->addWidget(hintLabel);
|
||||
layout()->addWidget(label);
|
||||
hintLabel->setText(QString("Time: 00:00\nFrame: 0\nStop key: ") + hotkeying::sequence("recordingstop"));
|
||||
@ -41,7 +45,7 @@ RecordingPreview::~RecordingPreview() {
|
||||
}
|
||||
|
||||
void RecordingPreview::setPixmap(QPixmap map) {
|
||||
label->setPixmap(map);
|
||||
label->setPixmap(map.scaled(label->maximumSize()));
|
||||
}
|
||||
void RecordingPreview::setTime(QString time, int frame) {
|
||||
if (isVisible())
|
||||
|
Loading…
Reference in New Issue
Block a user