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