UI: Allow resize without timers

This prevents the weird stretching effect that occurs whenever a windows
is in the process of being resized by the user.

Originally it was intended as an optimization, but even on half-decent
computers it doesn't really have much benefit.
This commit is contained in:
jp9000
2015-07-03 10:10:23 -07:00
parent b4fe4ae5b4
commit b566428233
8 changed files with 17 additions and 79 deletions

View File

@@ -1956,9 +1956,8 @@ void OBSBasic::ResizePreview(uint32_t cx, uint32_t cy)
previewY += float(PREVIEW_EDGE_SIZE);
if (isVisible()) {
if (resizeTimer)
killTimer(resizeTimer);
resizeTimer = startTimer(100);
QSize size = GetPixelSize(ui->preview);
obs_resize(size.width(), size.height());
}
}
@@ -2057,18 +2056,7 @@ void OBSBasic::resizeEvent(QResizeEvent *event)
if (obs_get_video_info(&ovi))
ResizePreview(ovi.base_width, ovi.base_height);
UNUSED_PARAMETER(event);
}
void OBSBasic::timerEvent(QTimerEvent *event)
{
if (event->timerId() == resizeTimer) {
killTimer(resizeTimer);
resizeTimer = 0;
QSize size = GetPixelSize(ui->preview);
obs_resize(size.width(), size.height());
}
OBSMainWindow::resizeEvent(event);
}
void OBSBasic::on_actionShow_Recordings_triggered()