ScreenRecorder: Remember the crop area across recordings of same size

If multiple recordings were made in a row, the crop area was reset each
time and had to be reselected by users. This change implements the
retaining of the cropping area during the lifetime of the Recording
dialog, as long as the clip size does not change.

A potential trap is now, though, that the cropping area remains the same
even if the screen gets changed or the screen recording area was just
moved. But I believe that the new convenience outweighs this corner
case.

Change-Id: I0326dfcad6827b2d504a4e309891824b16b6a47c
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Alessandro Portale
2023-10-18 21:25:41 +02:00
parent 81898c675c
commit 3438b03af6

View File

@@ -783,8 +783,9 @@ CropAndTrimWidget::CropAndTrimWidget(QWidget *parent)
void CropAndTrimWidget::setClip(const ClipInfo &clip)
{
if (clip.dimensions != m_clipInfo.dimensions)
m_cropRect = {QPoint(), clip.dimensions}; // Reset only if clip size changed
m_clipInfo = clip;
m_cropRect = {QPoint(), clip.dimensions};
m_currentFrame = 0;
m_trimRange = {m_currentFrame, m_clipInfo.framesCount()};
updateWidgets();