From b5b271cd4ce4398a644073a8bc47e00766893926 Mon Sep 17 00:00:00 2001 From: wangcong Date: Thu, 24 Aug 2023 15:32:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BF=AB=E6=8D=B7=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E5=BD=95=E5=88=B6=E6=97=B6=EF=BC=8C=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=B7=A6=E4=B8=8A=E8=A7=92=E6=8D=95=E6=8D=89=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E6=8F=90=E7=A4=BA=E3=80=81=E4=B8=8D=E7=94=BB?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E7=9A=84=E9=BB=91=E8=89=B2=E8=83=8C=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: 快捷全屏录制时,不显示左上角捕捉区域大小提示、不画窗口的黑色背景 Log: 快捷全屏录制时,不显示左上角捕捉区域大小提示、不画窗口的黑色背景 Bug: https://pms.uniontech.com/bug-view-213709.html --- src/main_window.cpp | 10 ++++++---- src/main_window.h | 3 ++- src/widgets/toptips.cpp | 6 ++++++ src/widgets/toptips.h | 11 ++++++++++- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/main_window.cpp b/src/main_window.cpp index b6a04c90..71c6d6bd 100755 --- a/src/main_window.cpp +++ b/src/main_window.cpp @@ -284,6 +284,7 @@ void MainWindow::initAttributes() m_sideBar->hide(); m_sizeTips = new TopTips(this); + m_sizeTips->setFullScreenRecord(m_isFullScreenRecord); m_sizeTips->hide(); if (m_functionType == status::record) { @@ -1555,7 +1556,6 @@ void MainWindow::fullScreenRecord(const QString fileName) this->initAttributes(); this->initResource(); this->initLaunchMode("screenRecord"); - recordButtonStatus = RECORD_BUTTON_RECORDING; this->showFullScreen(); qApp->setOverrideCursor(BaseUtils::setCursorShape("start")); @@ -3441,15 +3441,17 @@ void MainWindow::paintEvent(QPaintEvent *event) painter.setClipping(true); //使用指定的剪辑操作将剪辑区域设置为给定区域 painter.setClipRegion(QRegion(backgroundRect).subtracted(QRegion(frameRect))); - //画出当前背景 - painter.drawRect(backgroundRect); + //快捷全屏录制不需要画背景,非快捷全屏录制需要画背景 + if(!m_isFullScreenRecord) + //画出当前背景 + painter.drawRect(backgroundRect); // Reset clip. 重设剪辑区域 painter.setClipRegion(QRegion(backgroundRect)); //捕捉区域 frameRect = QRect(recordX, recordY, recordWidth, recordHeight); // Draw frame. 画捕捉区域的虚线框;滚动截图模式中,已经开始滚动后,保存时不画虚线框 - if (recordButtonStatus != RECORD_BUTTON_RECORDING && !(status::scrollshot == m_functionType && m_isSaveScrollShot)) { + if (!m_isFullScreenRecord && recordButtonStatus != RECORD_BUTTON_RECORDING && !(status::scrollshot == m_functionType && m_isSaveScrollShot)) { //qDebug() << "function: " << __func__ << " ,line: " << __LINE__; painter.setRenderHint(QPainter::Antialiasing, false); //QPen framePen(QColor("#01bdff")); diff --git a/src/main_window.h b/src/main_window.h index 3261893c..bdd2b7a4 100755 --- a/src/main_window.h +++ b/src/main_window.h @@ -1044,7 +1044,8 @@ public slots: bool m_isScreenResolutionChanged = false; /** - * @brief m_isFullScreenRecord 全屏录制 + * @brief m_isFullScreenRecord 快捷全屏录制 + * 通过命令行deepin-screen-recorder --rf 启动的全屏录制,未静默状态,不会显示任何相关提示 */ bool m_isFullScreenRecord = false; }; diff --git a/src/widgets/toptips.cpp b/src/widgets/toptips.cpp index 3c277cf4..ea7b0e75 100755 --- a/src/widgets/toptips.cpp +++ b/src/widgets/toptips.cpp @@ -55,6 +55,7 @@ void TopTips::setContent(const QSize &size) void TopTips::updateTips(QPoint pos, const QSize &size) { + if(m_isFullScreenRecord) return; if (!this->isVisible()) this->show(); @@ -90,3 +91,8 @@ void TopTips::setRecorderTipsInfo(const bool showState) m_showRecorderTips = showState; } } + +void TopTips::setFullScreenRecord(const bool flag) +{ + m_isFullScreenRecord = flag; +} diff --git a/src/widgets/toptips.h b/src/widgets/toptips.h index 6b3552cb..a3658d1e 100755 --- a/src/widgets/toptips.h +++ b/src/widgets/toptips.h @@ -11,7 +11,9 @@ #include DWIDGET_USE_NAMESPACE - +/** + * @brief The TopTips class 捕捉区域大小提示界面(除滚动截图外) + */ class TopTips : public QLabel { Q_OBJECT @@ -19,6 +21,7 @@ class TopTips : public QLabel explicit TopTips(DWidget *parent = nullptr); ~TopTips() override; void setRecorderTipsInfo(const bool showState); + void setFullScreenRecord(const bool flag); public slots: void setContent(const QSize &rect); void updateTips(QPoint pos, const QSize &rect); @@ -28,5 +31,11 @@ public slots: bool m_showRecorderTips = false; int m_width = 0; int m_height = 0; + + /** + * @brief m_isFullScreenRecord 快捷全屏录制的标志 + * 快捷全屏录制时,不需要显示此界面 + */ + bool m_isFullScreenRecord = false; }; #endif // TOPTIPS_H