From 38690bc7d01dae661ada1aaf95b4982345ff0620 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 7 Sep 2023 22:35:13 +0200 Subject: [PATCH] ScreenRecorder: Make dialog less cluttered and non-resizable The "Trim and Crop..." button now jas a static text and shows crop and trim details via tooltip. The confusing resizability of the dialog is prevented. Change-Id: If967d8014a0751f7d2360bf7b239bf22f070024c Reviewed-by: Reviewed-by: Alessandro Portale --- src/plugins/screenrecorder/cropandtrim.cpp | 22 +++++++++++-------- src/plugins/screenrecorder/record.cpp | 2 ++ .../screenrecorder/screenrecorderplugin.cpp | 3 ++- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/plugins/screenrecorder/cropandtrim.cpp b/src/plugins/screenrecorder/cropandtrim.cpp index 992221b106e..16cdb3ec3c3 100644 --- a/src/plugins/screenrecorder/cropandtrim.cpp +++ b/src/plugins/screenrecorder/cropandtrim.cpp @@ -688,6 +688,7 @@ CropAndTrimWidget::CropAndTrimWidget(QWidget *parent) : StyledBar(parent) { m_button = new QToolButton; + m_button->setText(Tr::tr("Crop and Trim...")); m_cropSizeWarningIcon = new CropSizeWarningIcon(CropSizeWarningIcon::ToolBarVariant); @@ -727,17 +728,20 @@ void CropAndTrimWidget::setClip(const ClipInfo &clip) void CropAndTrimWidget::updateWidgets() { - const QString cropText = - !m_clipInfo.isCompleteArea(m_cropRect) - ? Tr::tr("Crop to %1x%2px.").arg(m_cropRect.width()).arg(m_cropRect.height()) - : Tr::tr("Complete area."); + if (!m_clipInfo.isNull()) { + const QString cropText = + !m_clipInfo.isCompleteArea(m_cropRect) + ? Tr::tr("Crop to %1x%2px.").arg(m_cropRect.width()).arg(m_cropRect.height()) + : Tr::tr("Complete area."); - const QString trimText = - !m_clipInfo.isCompleteRange(m_trimRange) - ? Tr::tr("Frames %1 to %2.").arg(m_trimRange.first).arg(m_trimRange.second) - : Tr::tr("Complete clip."); + const QString trimText = + !m_clipInfo.isCompleteRange(m_trimRange) + ? Tr::tr("Frames %1 to %2.").arg(m_trimRange.first).arg(m_trimRange.second) + : Tr::tr("Complete clip."); + + m_button->setToolTip(cropText + " " + trimText); + } - m_button->setText(cropText + " " + trimText + ".."); m_cropSizeWarningIcon->setCropSize(m_cropRect.size()); } diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index d60501e092a..51c80d6d42b 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -174,6 +174,8 @@ RecordWidget::RecordWidget(const FilePath &recordFile, QWidget *parent) : StyledBar(parent) , m_recordFile(recordFile) { + setMinimumWidth(220); + m_process = new Process(this); m_process->setUseCtrlCStub(true); m_process->setProcessMode(ProcessMode::Writer); diff --git a/src/plugins/screenrecorder/screenrecorderplugin.cpp b/src/plugins/screenrecorder/screenrecorderplugin.cpp index d1e4c070951..f84e866e935 100644 --- a/src/plugins/screenrecorder/screenrecorderplugin.cpp +++ b/src/plugins/screenrecorder/screenrecorderplugin.cpp @@ -44,7 +44,6 @@ public: , m_recordFile("XXXXXX" + RecordWidget::recordFileExtension()) { setWindowTitle(Tr::tr("Record Screen")); - setMinimumWidth(320); StyleHelper::setPanelWidget(this); m_recordFile.open(); @@ -89,6 +88,8 @@ public: m_spinner = new SpinnerSolution::Spinner(SpinnerSolution::SpinnerSize::Medium, this); m_spinner->hide(); + + layout()->setSizeConstraint(QLayout::SetFixedSize); } private: